Skip to content

Instantly share code, notes, and snippets.

@csaunders
Created August 8, 2013 04:24
Show Gist options
  • Save csaunders/6181420 to your computer and use it in GitHub Desktop.
Save csaunders/6181420 to your computer and use it in GitHub Desktop.
Really confused as to why my nginx 403's when visiting / instead of redirecting to /brews
upstream brewwatcher_server {
server 127.0.0.1:4567 fail_timeout=0;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;
gzip on;
gzip_vary on;
gzip_min_length 500;
#gzip on;
server {
listen 80;
server_name localhost;
root /home/csaunders/brewwatcher/ruby/public;
client_max_body_size 4G;
keepalive_timeout 5;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
#}
location / {
try_files @brewwatcher $uri;
}
location @brewwatcher {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-By $server_addr:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Local-Proxy $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_pass http://brewwatcher_server;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment