This shows how to connect your application listening on TCP port <port number> (started with "-p" option in mgrg) to Nginx web server.
- Step 1:
You will need to edit the Nginx configuration file. For Ubuntu and similar:
sudo vi /etc/nginx/sites-enabled/default
Copied!
while on Fedora and other systems it might be at:
sudo vi /etc/nginx/nginx.conf
Copied!
Add the following in the "server {}" section ("/<app path>" is the application path, see request):
location /<app path>/ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:<port number>; }
Copied!
- Step 2:
Finally, restart Nginx:
sudo systemctl restart nginx
Copied!
Note: you must not have any other URL resource that starts with "/<app path>/" (such as for example "/<app path>/something") as the web server will attempt to pass them as a reverse proxy request, and they will likely not work. If you need to, you can change the application path to be different from "/<app path>", see request.