2023-05-10 00:59:41 +02:00
|
|
|
# An nginx configuration that can be used to reverse proxy connections to your
|
|
|
|
# Platypush' HTTP service.
|
|
|
|
|
2023-09-01 01:09:38 +02:00
|
|
|
upstream platypush {
|
|
|
|
# The address and port where the HTTP backend is listening
|
|
|
|
server 127.0.0.1:8008;
|
|
|
|
}
|
|
|
|
|
2023-05-10 00:59:41 +02:00
|
|
|
server {
|
2023-09-01 01:09:38 +02:00
|
|
|
server_name platypush.example.com;
|
2023-05-10 00:59:41 +02:00
|
|
|
|
2023-09-01 01:09:38 +02:00
|
|
|
# Proxy standard HTTP connections
|
2023-05-10 00:59:41 +02:00
|
|
|
location / {
|
2023-09-01 01:09:38 +02:00
|
|
|
proxy_pass http://platypush;
|
2023-05-10 00:59:41 +02:00
|
|
|
|
|
|
|
client_max_body_size 5M;
|
|
|
|
proxy_read_timeout 60;
|
|
|
|
proxy_connect_timeout 60;
|
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-Ssl on;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Proxy websocket connections
|
2023-09-01 01:09:38 +02:00
|
|
|
location /ws/ {
|
|
|
|
proxy_pass http://platypush;
|
2023-05-10 00:59:41 +02:00
|
|
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_redirect off;
|
|
|
|
proxy_http_version 1.1;
|
2023-09-01 01:09:38 +02:00
|
|
|
client_max_body_size 5M;
|
2023-05-10 00:59:41 +02:00
|
|
|
proxy_set_header Host $http_host;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Optional SSL configuration - using Let's Encrypt certificates in this case
|
|
|
|
# listen 443 ssl;
|
2023-09-01 01:09:38 +02:00
|
|
|
# ssl_certificate /etc/letsencrypt/live/platypush.example.com/fullchain.pem;
|
|
|
|
# ssl_certificate_key /etc/letsencrypt/live/platypush.example.com/privkey.pem;
|
2023-05-10 00:59:41 +02:00
|
|
|
# include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
|
|
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
}
|
2023-09-01 01:09:38 +02:00
|
|
|
|
|
|
|
# Uncomment if you are using SSL and you want to force an HTTPS upgrade to
|
|
|
|
# clients connecting over the port 80
|
|
|
|
# server {
|
|
|
|
# if ($host = platypush.example.com) {
|
|
|
|
# return 301 https://$host$request_uri;
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# server_name platypush.example.com;
|
|
|
|
# listen 80;
|
|
|
|
# return 404;
|
|
|
|
# }
|