Nginx Configuration
This guide describes how to implement a reverse proxy in Nginx for Daployi, including correct WebSockets support.
API Configuration Example
Below is an example of an Nginx configuration for the Daployi API.
server {
server_name api.daployi.yourdomain.com; # managed by Certbot
access_log /var/log/nginx/web.access.log;
location / {
proxy_pass http://127.0.0.1:3005;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_connect_timeout 75s;
proxy_read_timeout 3600s; # 1 hour
proxy_send_timeout 3600s;
proxy_buffering off;
}
##SSL CONFIG HERE
}
WebSockets Configuration
To prevent socket issues, it is important to include the following specific configuration for WebSockets:
WebSockets Specific Config
proxy_connect_timeout 75s;
proxy_read_timeout 3600s; # 1 hour
proxy_send_timeout 3600s;
proxy_buffering off;
Web Configuration Example
Below is an example of an Nginx configuration for the Daployi Web interface.
server {
server_name daployi.yourdomain.com; # managed by Certbot
access_log /var/log/nginx/api.access.log;
location / {
proxy_pass http://127.0.0.1:3006;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
##SSL CONFIG HERE
}