docker icon indicating copy to clipboard operation
docker copied to clipboard

SYMFONY__ENV__SERVER_NAME appears to be load bearing

Open nbgibson opened this issue 3 years ago • 1 comments

Context Per the Readme, SYMFONY__ENV__SERVER_NAME functions as a means to specify a user readable 2FA name. However this variable appears to have much larger implications. If malformed, CSS and other app functionality breaks down. In the event that a user is attempting to utilize a reverse proxy to access the app, the value of the variable become critical as simply targeting IP:PORT is not possible.

Request: Short Term Additional documentation on the functioning of this variable in the readme, preferably with an added example or two for how to properly set it for normal and behind a reverse proxy operations.

Long Term A reworking of the app to more gracefully handle calls from different sources (eg: SYMFONY__ENV__SERVER_NAME set to foo.bar.biz renders LAN usage from IP:Port functionally useless due to formatting and other aspects breaking) so that SYMFONY__ENV__SERVER_NAME is no longer mission critical for functionality.

nbgibson avatar May 13 '21 19:05 nbgibson

Hello! I am having the same issue, I am trying to expose a local instance of wallabag through a public IP address where nginx acts as a reverse proxy.

When I reach my instance through the vlan it functions as expected

To test it I am running the sample docker for development which relies on sqlite like

docker run -v /opt/wallabag/data:/var/www/wallabag/data -v /opt/wallabag/images:/var/www/wallabag/web/assets/images -p 8080:80 -e "SYMFONY__ENV__DOMAIN_NAME=http://10.1.1.12:8080" -e "SYMFONY__ENV__SERVER_NAME=https://wallabag.external.net"  wallabag/wallabag

As you might imagine, 10.1.1.12:8080 is the local wallabag endpoint and wallabag.external.net is the domain name where nginx is configured to redirect and manage the tls endpoint.

My nginx conf has nothing peculiar

    server {
        listen 443 ssl;
        listen [::]:443 ssl ;

        server_name wallabag.external.net;

        ssl_certificate ...
        include ssl-params.inc;

        location / {
            proxy_pass http://10.1.1.12:8080;

            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-Port $server_port;

        }

Still, whenever I try to connect to wallabag.external.net the login and routing script are server correctly, but all other resources like js and css, are fetched from the private IP address, http://10.1.1.12:8080, which of course makes the application unusable.

Anyway, I also tried to place the instance private ip address SYMFONY__ENV__SERVER_NAME but it makes no effect. If you have solved it somehow please let me know!

fisiognomico avatar Aug 08 '22 23:08 fisiognomico