Skip to content

Instantly share code, notes, and snippets.

@andhart
Created February 22, 2021 23:43
Show Gist options
  • Save andhart/2173a7da2db1832d0922e707f0ce453b to your computer and use it in GitHub Desktop.
Save andhart/2173a7da2db1832d0922e707f0ce453b to your computer and use it in GitHub Desktop.
## Version 2019/08/01 - Changelog: https://github.com/linuxserver/docker-letsencrypt/commits/master/root/defaults/default
# redirect all traffic to https
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
server {
server_name _;
listen 443 ssl http2;
listen [::]:443 ssl http2;
root /var/www/hudu2/public;
index index.html;
include /config/nginx/ssl.conf;
# deny requests for files that should never be accessed
location ~ /\. {
deny all;
}
location ~* ^.+\.(rb|log)$ {
deny all;
}
# send non-static file requests to the app server
location / {
try_files $uri @rails;
}
location @rails {
include /config/nginx/proxy.conf;
proxy_pass http://app:3000;
}
}
# 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment