forked from chaosdorf/mete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
50 lines (49 loc) · 1.49 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
error_log stderr;
events {
worker_connections 1024;
}
http {
client_body_temp_path /tmp/client_body_temp;
fastcgi_temp_path /tmp/fastcgi_temp;
proxy_temp_path /tmp/proxy_temp;
scgi_temp_path /tmp/scgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
upstream appserver {
server app:8080;
}
server {
include mime.types;
access_log off;
listen [::]:80 ipv6only=off;
proxy_redirect 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;
error_page 404 /404.html;
error_page 422 /422.html;
error_page 500 /500.html;
error_page 502 /502.html;
location / {
try_files $uri @backend;
root /usr/share/nginx/html/public;
}
location @backend {
rewrite ^/audits\.json$ /api/v1/audits.json last;
rewrite ^/barcodes\.json$ /api/v1/barcodes.json last;
rewrite ^/barcodes/(.*)\.json$ /api/v1/barcodes/$1.json last;
rewrite ^/drinks\.json$ /api/v1/drinks.json last;
rewrite ^/drinks/(.*)\.json$ /api/v1/drinks/$1.json last;
rewrite ^/users\.json$ /api/v1/users.json last;
rewrite ^/users/(.*)\.json$ /api/v1/users/$1.json last;
proxy_pass http://appserver;
}
location /ws {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header CLIENT_IP $remote_addr;
proxy_read_timeout 86400;
proxy_pass http://appserver;
}
}
}