I am currently running a cloud https server and a document https server behind an nginx reverse proxy server. Additionally I am running an openvpn server on UDP port 1194 (also on the cloud sever), which I would like to route via the nginx reverse proxy server on TCP port 443. I would appreciate any hints as I lack any experience on nginx.
This is my configuration file, naturally, example.org is not my real URL:
worker_processes 4; # Default 1
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
events {
worker_connections 512; # Default 1024
}
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
## Compression
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 9;
gzip_http_version 1.1;
gzip_min_length 10;
gzip_types text/plain text/css application/x-javascript text/xml;
gzip_vary on;
gzip_static on; #Needs compilation with gzip_static support
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
## Server configuration
server {
listen 443 ssl;
server_name example.org;
ssl on;
ssl_certificate /root/fullchain.pem;
ssl_certificate_key /root/privkey.pem;
server_name_in_redirect off;
access_log logs/access.log;
client_max_body_size 10G ;
## proxy the PHP scripts to Apache listening on 127.0.0.1:80
location /nextcloud {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_pass https://cloudserver:443;
}
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_redirect off;
proxy_buffering off;
proxy_pass https://documentserver:443/;
}
}
}
This is my configuration file, naturally, example.org is not my real URL:
worker_processes 4; # Default 1
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
events {
worker_connections 512; # Default 1024
}
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
## Compression
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 9;
gzip_http_version 1.1;
gzip_min_length 10;
gzip_types text/plain text/css application/x-javascript text/xml;
gzip_vary on;
gzip_static on; #Needs compilation with gzip_static support
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
## Server configuration
server {
listen 443 ssl;
server_name example.org;
ssl on;
ssl_certificate /root/fullchain.pem;
ssl_certificate_key /root/privkey.pem;
server_name_in_redirect off;
access_log logs/access.log;
client_max_body_size 10G ;
## proxy the PHP scripts to Apache listening on 127.0.0.1:80
location /nextcloud {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_pass https://cloudserver:443;
}
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_redirect off;
proxy_buffering off;
proxy_pass https://documentserver:443/;
}
}
}