Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
NGINX Reverse proxy settings to Github pages
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;
}
}

sdvgt commented Dec 14, 2015

Sorry mmm... Where do you add this file to work?

katopz commented Apr 11, 2016

nginx: [emerg] "proxy_redirect default" cannot be used with "proxy_pass" directive with variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment