My YunoHost server
Hardware: VirtualBox with 1GB of RAM
YunoHost version: 4.0.8
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain:
I am trying to package a new Python app (https://github.com/spiral-project/copanier_ynh) on a VirtualBox instance, aliased as the “yunohost.local” domain.
Description of my issue
The app runs on localhost:2244
, and I am trying to make it work via nginx. The install template has written the file /etc/nginx/conf.d/yunohost.local.d/copanier.conf
, which content is:
rewrite ^/copanier$ /copanier/ permanent;
location /copanier/ {
# Force usage of https
#if ($scheme = http) {
# rewrite ^ https://$server_name$request_uri? permanent;
#}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2244/;
proxy_redirect off;
client_max_body_size 10M;
# Include SSOWAT user panel.
#include conf.d/yunohost_panel.conf.inc;
}
location /copanier/static {
alias /var/www/copanier/static/;
}
When I click on the user dashboard on the “Copanier” app, I am directed to https://yunohost.local/copanier
, and then https://yunohost.local/copanier/
and then https://yunohost.local/connexion?next=/
and finally to https://yunohost.local/yunohost/sso/
.
I looked at various apps that use reverse proxy, and I don’t get what I am missing to make this work as expected (aka, seeing the web interface of the app).
The /connexion?next=/
route is the one handled by the application as states an internal curl command:
curl -sSL http://localhost:2244/connexion?next=/ | head
<!DOCTYPE html>
<html>
<head>
<title>Copanier</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="/static/app.css">
It sounds like the redirect should have been to /copanier/connexion
and not /connexion
.
I am confused why the proxy pass does not rewrite this.
Thanks for your help