Skip to content

Example Nethloader nginx proxy config

Guillem Arias edited this page Jun 21, 2018 · 1 revision

This is a portion of an example nginx configuration including the proxies to serve Nethloader backend. Keep in mind the paths stored in the config files.

...

   # Proxy main API endpoint
   location /api {
        proxy_pass http://localhost:4000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    
    # Proxy frontend API endpoint
    location /graphql {
        proxy_pass http://localhost:4000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    
    # Proxy upload page
    location ~ "^/([A-Za-z0-9_~]{10})$" {
        proxy_pass http://localhost:4000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        }

    # Proxy ShareX API endpoint
    location /sharex {
        proxy_pass http://localhost:4000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

    # Proxy raw images
    location /media {
        alias /path/to/server/uploads/folder;
    }

...

Nethloader demo

Credentials:

username: demo@demo.com

password: demo

Clone this wiki locally