Hi all, I have managed to setup nginx as reverse proxy for most of my home server web apps with a lets encrypt ssl. So far, I managed to get the forwarding working for Nextcloud, Plex, Emby and Rutorrent which are some of the web apps that I use.
My main nginx conf file is as below:
server {
listen 443 ssl;
server_name abc.com;
include ssl_common.conf;
include proxy_setup.conf;
include mime.types;
default_type application/octet-stream;
#access_log logs/host.access.log main;
location / {
root /usr/local/www/nginx;
index index.html index.htm;
}
For all the forwarding I use a proxy.conf file, under which I have defined my forwarding rules. Example for Nextcloud:
location /nextcloud {
proxy_pass http://192.168.x.x/nextcloud;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
The above works well for the web apps that I mentioned most probably because the web root corresponds and matches to the location /path that I defined. The issue I'm facing is for most of my hardware based devices such as a BuffaloNAS and a CCTV DVR. For the buffalo nas, the LAN url is http://192.168.x.x/static/index.html
If I set location /static it does not work and i get error 404 of nignx. My cctv on the other hand is a direct url http://192.168.x.x with no forward slash path which makes me nuts in figuring how do I define the /location.
Someone having any idea here please please help. Thank you.
My main nginx conf file is as below:
server {
listen 443 ssl;
server_name abc.com;
include ssl_common.conf;
include proxy_setup.conf;
include mime.types;
default_type application/octet-stream;
#access_log logs/host.access.log main;
location / {
root /usr/local/www/nginx;
index index.html index.htm;
}
For all the forwarding I use a proxy.conf file, under which I have defined my forwarding rules. Example for Nextcloud:
location /nextcloud {
proxy_pass http://192.168.x.x/nextcloud;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
The above works well for the web apps that I mentioned most probably because the web root corresponds and matches to the location /path that I defined. The issue I'm facing is for most of my hardware based devices such as a BuffaloNAS and a CCTV DVR. For the buffalo nas, the LAN url is http://192.168.x.x/static/index.html
If I set location /static it does not work and i get error 404 of nignx. My cctv on the other hand is a direct url http://192.168.x.x with no forward slash path which makes me nuts in figuring how do I define the /location.
Someone having any idea here please please help. Thank you.