Skip to content

Instantly share code, notes, and snippets.

@janurag
Forked from aregee/nginx.conf
Last active January 12, 2016 07:44
Show Gist options
  • Save janurag/11a7fb995cd0b42f407a to your computer and use it in GitHub Desktop.
Save janurag/11a7fb995cd0b42f407a to your computer and use it in GitHub Desktop.
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 65;
types_hash_max_size 2048;
gzip on;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
index index.html index.htm;
server {
listen 80;
server_name localhost;
large_client_header_buffers 4 32k;
location /api {
rewrite /api(.*) /$1 break;
proxy_pass http://127.0.0.1:9092;
proxy_redirect off;
proxy_set_header Host $host;
}
location / {
proxy_set_header Host 'mit-frontend.s3-website-us-west-2.amazonaws.com';
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_intercept_errors on;
proxy_pass http://mit-frontend.s3-website-us-west-2.amazonaws.com;
expires 1y;
log_not_found off;
}
location ~/dist/ {
rewrite ^/dist/(.*)$ http://mit-frontend.s3-website-us-west-2.amazonaws.com/dist/$1 redirect;
}
location ~/public/ {
rewrite ^/public/(.*)$ http://mit-frontend.s3-website-us-west-2.amazonaws.com/public/$1 redirect;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment