Create aspnet.subdomain.conf.sample

This commit is contained in:
mguinness 2020-08-11 16:03:45 -07:00 committed by GitHub
commit 942c2f12c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,26 @@
# aspnet reverse proxy configuration for https to http on duckdns subdomain
# replace <subdomain> w/ duckdns subdomain & <container> w/ http service name
# add environment variable ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true" in docker
server {
listen 443 ssl http2 default_server;
server_name _;
include /config/nginx/ssl.conf;
return 301 https://www.$host$request_uri;
}
server {
listen 443 ssl http2;
server_name *.<subdomain>.duckdns.org;
include /config/nginx/ssl.conf;
location / {
proxy_pass http://<container>;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}