diff --git a/aspnet.subdomain.conf.sample b/aspnet.subdomain.conf.sample new file mode 100644 index 0000000..e1f5537 --- /dev/null +++ b/aspnet.subdomain.conf.sample @@ -0,0 +1,26 @@ +# aspnet reverse proxy configuration for https to http on duckdns subdomain +# replace w/ duckdns subdomain & 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 *..duckdns.org; + include /config/nginx/ssl.conf; + location / { + proxy_pass http://; + 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; + } +}