glauth-ui
glauth-ui copied to clipboard
Issues with reverse proxy and serving from subdirectory.
I added the following config option to solving issues using nginx as reverse proxy and serving the app in the subdirectory like subdomain.example.com/glauth
:
SERVER_NAME = os.environ.get('BASE_URL')
I still cant get this to work tho and only getting 404 erros when trying to access anything. Any help on this would be very much appreciated :)
I tried:
server {
listen 443 ssl http2;
server_name subdomain.example.com;
include /etc/nginx/ssl-stuff.conf;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
client_max_body_size 100M;
location ~/glauth(.*) {
proxy_pass http://127.0.0.1:3005$1;
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 Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
as well as
location /glauth/ {
proxy_pass http://127.0.0.1:3005$1;
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 Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
Settings the SERVER_NAME
to subdomain.example.com/glauth
makes the all links look correct but it still results in 404 errors. Without the subdirectory everything works without any issues even without the server_name set.
The issues is probably with some of the proxy_header settings but i dont have much experience with this.