Closed ponchohoncho closed 2 years ago
I swear I've gotten it to work with Swag a few months ago. I have the config saved, let me know if this works:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name pasta.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
# enable for ldap auth, fill in ldap details in ldap.conf
#include /config/nginx/ldap.conf;
# enable for Authelia
#include /config/nginx/authelia-server.conf;
location / {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable the next two lines for ldap auth
#auth_request /auth;
#error_page 401 =200 /ldaplogin;
# enable for Authelia
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app pasta;
set $upstream_port 80;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
}
}
Also, in case anyone needs it--here is a Swag subfolder conf that worked for me
location /pasta {
return 301 $scheme://$host/pasta/;
}
location ^~ /pasta/ {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app pasta;
set $upstream_port 80;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
rewrite /pasta(.*) $1 break;
}
aha! It was I, the ding-dong, who put the public-facing port in the swag config. Thank you!
While we're here, I have the smallest docker-compose definition for future googlers
pasta:
image: cglatot/pasta
container_name: pasta
ports:
- 4480:80 #i chose 4480, you can make choose own
restart: unless-stopped
Glad you were able to get this sorted. Thanks for the additional information for the future :D
Hi! I'm trying to use Pasta behind an nginx reverse proxy (linuxserver/swag) and I can't seem to get it work right. I get a 501 BaD Gateway error. Looking at the SWAG logs, something in your container is refusing the connection, likely due to a hostname/fqdn thing?
Navigating to the IP:port works fine, but with a simple swag subdomain conf, it fails.
Thanks for your help!