-
|
Hi all!
What is the correct way to reverse proxy it? location /cable/ {
proxy_pass http://127.0.0.1:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# proxy_read_timeout 86400;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:4000;
proxy_ssl_verify off;
proxy_connect_timeout 150s;
proxy_buffering off;
}This configuration does not work :( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey @daitangio this configuration works for me: events {
worker_connections 1024;
}
http {
upstream campfire {
# Change to the URL of the Campfire instance to proxy to; e.g. "127.0.0.1:4000" instead of "campfire:80"
server campfire:80;
}
server {
listen 80;
# Change to your DNS entry; e.g. "chat.example.com" instead of "localhost"
server_name localhost;
location /cable {
proxy_pass http://campfire;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
location / {
proxy_pass http://campfire;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
}
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}I'm not sure how you are running Campfire, but in case you are running it without a container do keep in mind that you'll have to configure sendfile in nginx too. You have to configure it such that it serves assets and storage/uploads. If you are running it in a container, our advice is to target the port that Thruster is listening (HTTP_PORT env, if you changed it, defaults to 80) on instead of the Rails app (PORT env, if you changed it, defaults to 3000) directly. Thruster handles sendfile for you and provides some other niceties that make Campfire snappier. |
Beta Was this translation helpful? Give feedback.
Hey @daitangio this configuration works for me: