49 lines
1.2 KiB
Nginx Configuration File
49 lines
1.2 KiB
Nginx Configuration File
|
worker_processes 1;
|
||
|
|
||
|
events { worker_connections 1024; }
|
||
|
|
||
|
http {
|
||
|
upstream client {
|
||
|
server frontend:3000;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen 80;
|
||
|
error_log /var/log/nginx/error.log;
|
||
|
access_log /var/log/nginx/access.log;
|
||
|
client_max_body_size 10M;
|
||
|
|
||
|
location / {
|
||
|
proxy_pass http://client;
|
||
|
proxy_set_header Host $host;
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
proxy_set_header X-Forwarded-Ssl on; # Optional
|
||
|
proxy_set_header X-Forwarded-Port $server_port;
|
||
|
proxy_set_header X-Forwarded-Host $host;
|
||
|
# proxy_set_header X-Forwarded-Host $server_name;
|
||
|
}
|
||
|
|
||
|
location /api {
|
||
|
proxy_pass http://server:8000;
|
||
|
rewrite ^/api(.*)$ $1 break;
|
||
|
}
|
||
|
|
||
|
location /cable {
|
||
|
proxy_pass http://server:8000;
|
||
|
proxy_http_version 1.1;
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
proxy_set_header Connection "upgrade";
|
||
|
# rewrite ^/cable(.*)$ $1 break;
|
||
|
}
|
||
|
|
||
|
location /socksjs-node {
|
||
|
proxy_pass http://server:8000;
|
||
|
proxy_http_version 1.1;
|
||
|
proxy_set_header Upgrade $http_upgrade;
|
||
|
proxy_set_header Connection "upgrade";
|
||
|
# rewrite ^/cable(.*)$ $1 break;
|
||
|
}
|
||
|
}
|
||
|
}
|