Created
June 3, 2020 14:24
-
-
Save daffodilistic/4e1d692c46fe3bd3bd9d3fb56af2c9da to your computer and use it in GitHub Desktop.
Nginx Reverse Proxy to azurewebsites.net on an IPv6 Host behind CloudFlare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nginx configuration file for a simple reverse proxy from a domain to azurewebsites.net | |
# References: https://withouttheloop.com/articles/2017-07-23-nginx-letsencrypt-azure-web-app/ | |
# Note: Ensure your AAAA records for your domain under CloudFlare are configured! | |
# A records are not needed since Cloudflare will be proxying IPv6 to IPv4 requests for us. | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name myapp.site www.myapp.site; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host myapp.azurewebsites.net; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_ssl_session_reuse off; | |
proxy_pass https://myapp.azurewebsites.net; | |
proxy_redirect off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment