Hi.
I am using an application server on port 3065 and when I get to http://host:3065 it works. I would like to use nginx to proxy this server so it could serve that app.
The application suggests the following settings for nginx;
As you would know, "server", "backend" and "location" directives are not allowed in Additional nginx Directives section. And you would also know that sites-enabled directory is not present in Plesk installations.
So how to configure these kind of settings per domain for nginx?
Note; "Proxy mode" is disabled as per its definition suggests; "Turn off to stop using Apache." So I turned it off to use only nginx on that domain.
I am using an application server on port 3065 and when I get to http://host:3065 it works. I would like to use nginx to proxy this server so it could serve that app.
The application suggests the following settings for nginx;
Code:
upstream backend {
server 127.0.0.1:8065;
}
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;
server {
listen 80;
server_name example.com;
location /api/v3/users/websocket {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 50M;
proxy_set_header Host $http_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_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_pass http://backend;
}
location / {
client_max_body_size 50M;
proxy_set_header Connection "";
proxy_set_header Host $http_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_set_header X-Frame-Options SAMEORIGIN;
proxy_buffers 256 16k;
proxy_buffer_size 16k;
proxy_read_timeout 600s;
proxy_cache mattermost_cache;
proxy_cache_revalidate on;
proxy_cache_min_uses 2;
proxy_cache_use_stale timeout;
proxy_cache_lock on;
proxy_pass http://backend;
}
}
As you would know, "server", "backend" and "location" directives are not allowed in Additional nginx Directives section. And you would also know that sites-enabled directory is not present in Plesk installations.
So how to configure these kind of settings per domain for nginx?
Note; "Proxy mode" is disabled as per its definition suggests; "Turn off to stop using Apache." So I turned it off to use only nginx on that domain.