Last active
January 25, 2024 14:56
-
-
Save taddev/8872330 to your computer and use it in GitHub Desktop.
NGINX Reverse proxy settings to Github pages
This file contains 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
server { | |
listen 80 default_server; | |
listen [::]:80 ipv6only=on default_server; | |
server_name splunk.net blog.splunk.net www.splunk.net .taddevries.com; | |
access_log /var/log/nginx/blog.access_log main; | |
error_log /var/log/nginx/blog.error_log info; | |
return 301 https://blog.splunk.net; | |
} | |
server { | |
listen 443 default_server; | |
listen [::]:443 ipv6only=on default_server; | |
server_name blog.splunk.net; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/2013_blog_bundle.crt; | |
ssl_certificate_key /etc/nginx/ssl/splunk_4096.key; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | |
add_header Strict-Transport-Security max-age=31536000; | |
add_header X-Frame-Options DENY; | |
access_log /var/log/nginx/blog.secure.access_log main; | |
error_log /var/log/nginx/blog.secure.error_log info; | |
client_max_body_size 4m; | |
location / { | |
proxy_pass http://taddevries.github.io; | |
proxy_redirect default; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Protocol $scheme; | |
} | |
location /wp/64bit-putty { | |
return 301 https://blog.splunk.net/64bit-putty; | |
} | |
} |
nginx: [emerg] "proxy_redirect default" cannot be used with "proxy_pass" directive with variables
Hello, I tried using it, but got 404 (I try show site content on main domain without redirect to github);
Where I wrong? (Main difference from you - I not use SSL)
EDIT:
All is fine, I just add CNAME in the repository settings - after it, I got it is works
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry mmm... Where do you add this file to work?