Using Nginx and slashquery through unix socket

nginx socket

Nginx configuration:

upstream slashquery {
    server unix:/tmp/slashquery.sock;
    keepalive 60;

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;

    location / {
        proxy_pass http://slashquery;
        proxy_http_version 1.1; # for keep-alive
        proxy_redirect off;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Real-IP $remote_addr;

SlashQuery configuration:

  socket: /tmp/slashquery.sock

When socket is defined host and port are ignored.

comments powered by Disqus