2022-10-03 14:13:08 -04:00
|
|
|
## Version 2022/10/03 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/site-confs/default.conf.sample
|
2021-10-14 15:01:48 -04:00
|
|
|
|
|
|
|
# redirect all traffic to https
|
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# main server block
|
|
|
|
server {
|
2022-10-03 14:13:08 -04:00
|
|
|
listen 443 ssl http2 default_server;
|
|
|
|
listen [::]:443 ssl http2 default_server;
|
2021-10-14 15:01:48 -04:00
|
|
|
|
|
|
|
server_name _;
|
|
|
|
|
|
|
|
root /config/www;
|
|
|
|
index index.html index.htm index.php;
|
|
|
|
|
|
|
|
# enable subfolder method reverse proxy confs
|
|
|
|
include /config/nginx/proxy-confs/*.subfolder.conf;
|
|
|
|
|
|
|
|
# enable for ldap auth (requires ldap-location.conf in the location block)
|
|
|
|
#include /config/nginx/ldap-server.conf;
|
|
|
|
|
|
|
|
# enable for Authelia (requires authelia-location.conf in the location block)
|
|
|
|
#include /config/nginx/authelia-server.conf;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
# enable for basic auth
|
|
|
|
#auth_basic "Restricted";
|
|
|
|
#auth_basic_user_file /config/nginx/.htpasswd;
|
|
|
|
|
|
|
|
# enable for ldap auth (requires ldap-server.conf in the server block)
|
|
|
|
#include /config/nginx/ldap-location.conf;
|
|
|
|
|
|
|
|
# enable for Authelia (requires authelia-server.conf in the server block)
|
|
|
|
#include /config/nginx/authelia-location.conf;
|
|
|
|
|
2022-08-23 10:30:30 -04:00
|
|
|
try_files $uri $uri/ /index.html /index.php$is_args$args =404;
|
2021-10-14 15:01:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
location ~ ^(.+\.php)(.*)$ {
|
|
|
|
fastcgi_split_path_info ^(.+\.php)(.*)$;
|
|
|
|
fastcgi_pass 127.0.0.1:9000;
|
|
|
|
fastcgi_index index.php;
|
|
|
|
include /etc/nginx/fastcgi_params;
|
|
|
|
}
|
|
|
|
|
|
|
|
# deny access to .htaccess/.htpasswd files
|
|
|
|
location ~ /\.ht {
|
|
|
|
deny all;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# enable subdomain method reverse proxy confs
|
|
|
|
include /config/nginx/proxy-confs/*.subdomain.conf;
|
|
|
|
# enable proxy cache for auth
|
|
|
|
proxy_cache_path cache/ keys_zone=auth_cache:10m;
|