Skip to content

Instantly share code, notes, and snippets.

@ArnyminerZ
Created May 27, 2022 10:19
Show Gist options
  • Save ArnyminerZ/b670af704d39541e17e8b02d3d25b61f to your computer and use it in GitHub Desktop.
Save ArnyminerZ/b670af704d39541e17e8b02d3d25b61f to your computer and use it in GitHub Desktop.
QuMagie Reverse proxy

The system is running Nginx Proxy Manager, but the file must be edited manually at /data/nginx/proxy_host. Note that this reverse proxy is made to be working with a subdomain, in this case qumagie.***.com.

# ------------------------------------------------------------
# qumagie.***.com
# ------------------------------------------------------------
server {
set $forward_scheme http;
set $server "192.168.1.20";
set $port 9123;
listen 80;
listen [::]:80;
server_name qumagie.***.com;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
access_log /data/logs/proxy-host-9_access.log proxy;
error_log /data/logs/proxy-host-9_error.log warn;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Additional variables
set $redirect_uri "/apps/qumagie";
# Proxy
add_header X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $forward_scheme://$server:$port$redirect_uri$request_uri;
}
location ^~ /apps/qumagie {
rewrite ^/apps/qumagie/?(.*)$ http://qumagie.***.com/$1 permanent;
# return 301 http://qumagie.***.com/$1;
}
location /cgi-bin/images {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Additional variables
set $redirect_uri "/cgi-bin/images";
# Proxy
add_header X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $forward_scheme://$server:$port$redirect_uri$request_uri;
}
location /v3_menu {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Proxy
add_header X-Served-By $host;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass $forward_scheme://$server:$port$request_uri;
}
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment