-
Adding servers to nginx? (SOLVED)
I solved the problem, and once I found the right plugin it was pretty easy! The docker image I am working with is Technitium DNS I set the docker container network to "host" I installed CA User Scripts and created a new user script called enable-nginx-extensions with the following: #!/bin/bash # remove the config file if it already exists rm /etc/nginx/conf.d/nginx_extend.conf # symlink to the config file stored on the boot volume with the user script ln -s /boot/config/plugins/user.scripts/scripts/enable-nginx-extensions/nginx_extend.conf /etc/nginx/conf.d/ # restart nginx so that the new configuration file is picked up /etc/rc.d/rc.nginx restart I created a configuration file and stored it at /boot/config/plugins/user.scripts/scripts/enable-nginx-extensions/nginx_extend.conf server { listen 80; server_name new_server_name.local; location / { proxy_pass http://localhost:5380/; allow all; } } A couple of things to take note of: You must specify a server name - unraid is the default server and you can't change that. it has to be that way. Don't fight it Set the proxy_pass line to the ip/port where the upstream server is serving your application The allow all line is very important - without it, the application will try to authenticate the user against the unraid auth. This is almost certainly not what you want. I set the script to run at array start. I verified that my new site was available and restarted things a couple of times to make sure it persisted. I hope these steps help someone else out in the future!
-
Adding servers to nginx? (SOLVED)
Thanks for the reply. I see that the link you provided will create a new docker network and another separate nginx instance. This is definitely an option - just curious if it is the only option? The only reason we can't use the existing nginx installation is due to the configuration file being erased at reboot. I have tested creating an nginx configuration and it does work if you restart nginx.
-
Scott B started following Adding servers to nginx? (SOLVED)
-
Adding servers to nginx? (SOLVED)
I have a docker image running on my unraid server. I would like to reverse proxy it through the existing nginx instance that is serving up the unraid website. Although I have managed the changes required to the nginx config file, obviously it is overwritten every time the unraid server reboots. Is there any supported way I can persist this so that it survives reboots?
Scott B
Members
-
Joined
-
Last visited