[GH-ISSUE #73] proxy with nginx #50

Closed
opened 2026-03-03 16:04:00 +03:00 by kerem · 3 comments
Owner

Originally created by @kmcintyre on GitHub (Jun 24, 2016).
Original GitHub issue: https://github.com/mthenw/frontail/issues/73

Is it possible to proxy via nginx to a specific path - http://myserver/tail? I can only seem to get working at root context.

An example would be great, if available.

Originally created by @kmcintyre on GitHub (Jun 24, 2016). Original GitHub issue: https://github.com/mthenw/frontail/issues/73 Is it possible to proxy via nginx to a specific path - http://myserver/tail? I can only seem to get working at root context. An example would be great, if available.
kerem closed this issue 2026-03-03 16:04:00 +03:00
Author
Owner

@GeeWizWow commented on GitHub (Jul 31, 2016):

Reverse proxy should do the trick, something along these lines?

 server {
    listen 80;

    server_name myserver.com;

    location /tail {
        proxy_pass http://localhost:9001;
        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;
    }
}
<!-- gh-comment-id:236446949 --> @GeeWizWow commented on GitHub (Jul 31, 2016): Reverse proxy should do the trick, something along these lines? ``` server { listen 80; server_name myserver.com; location /tail { proxy_pass http://localhost:9001; 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; } } ```
Author
Owner

@mthenw commented on GitHub (Sep 4, 2016):

Closing for now. @kmcintyre let me know if @GeeWizWow solution didn't help.

<!-- gh-comment-id:244611587 --> @mthenw commented on GitHub (Sep 4, 2016): Closing for now. @kmcintyre let me know if @GeeWizWow solution didn't help.
Author
Owner

@kmcintyre commented on GitHub (Sep 4, 2016):

I see that, but I realized the browser when served the lib/web/index.html file 'as is' still didn't work for me.

I editing the index.html changing link and script to /assets/

<link rel="stylesheet" type="text/css" href="/assets/styles/__THEME__.css">

then copy -
/usr/lib/node_modules/frontail/node_modules/socket.io/node_modules/socket.io-client/socket.io.js to
/usr/lib/node_modules/frontail/lib/web/assets/socket.io/socket.io.js

Then finally nginx

location /tail {
    proxy_pass http://localhost:9001;
    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;
}

location /socket.io {
    proxy_pass http://localhost:9001;
    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;    
}

location /assets {
    # don't always know who ~is
    root  /usr/lib/node_modules/frontail/lib/web/;
} 

-- this works for me.

<!-- gh-comment-id:244615652 --> @kmcintyre commented on GitHub (Sep 4, 2016): I see that, but I realized the browser when served the lib/web/index.html file 'as is' still didn't work for me. I editing the index.html changing link and script to /assets/ ``` <link rel="stylesheet" type="text/css" href="/assets/styles/__THEME__.css"> ``` then copy - /usr/lib/node_modules/frontail/node_modules/socket.io/node_modules/socket.io-client/socket.io.js to /usr/lib/node_modules/frontail/lib/web/assets/socket.io/socket.io.js Then finally nginx ``` location /tail { proxy_pass http://localhost:9001; 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; } location /socket.io { proxy_pass http://localhost:9001; 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; } location /assets { # don't always know who ~is root /usr/lib/node_modules/frontail/lib/web/; } ``` -- this works for me.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/frontail#50
No description provided.