This shows how to connect your application listening on a Unix socket (started with 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) and "<app name>" is your application name):
location /<app path>/ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:///var/lib/gg/<app name>/sock/sock; }
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.