Skip to content

Instantly share code, notes, and snippets.

@fortl
Forked from rsboarder/gist:feae1ae6dc605ed1be28
Last active August 29, 2015 14:10
Show Gist options
  • Save fortl/23eb6c964bfac5dc0475 to your computer and use it in GitHub Desktop.
Save fortl/23eb6c964bfac5dc0475 to your computer and use it in GitHub Desktop.
user root wheel;
worker_processes 1;
error_log /var/log/nginx/error.log;
error_log /var/log/nginx/error.log notice;
error_log /var/log/nginx/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
listen 80;
listen 443 ssl;
server_name localhost;
root /Users/rsboarder/Dropbox/workspace/web/public/files;
access_log /var/log/nginx/rs.access.log main;
error_log /var/log/nginx/rs.error.log debug;
client_max_body_size 60m;
######Proxy headers
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-HTTPS $http_https;
location /cache.appcache {
open_file_cache off;
open_file_cache_errors off;
expires -1;
default_type text/cache-manifest;
# access_log logs/static.log; # I don't usually include a static log
}
location /api/ {
proxy_pass http://rs.dev.plurch.com;
access_log /var/log/nginx/server.access.log main;
proxy_set_header Authorization "Basic bXo6M2U0cjV0";
# a2luZzppc25ha2Vk" is "user:password" base64 encoded,
}
location / {
root /Users/rsboarder/Dropbox/workspace/web/public/files;
access_log /var/log/nginx/local.access.log main;
expires -1;
add_header Cache-Control public;
open_file_cache off;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment