AnswerBun.com

NGINX/GemInABox - static links aren't properly passed

Server Fault Asked by AnotherClueless on December 8, 2020

NGINX location config:

location /geminabox/ {
  client_body_buffer_size    128K;
  client_max_body_size       16M;

  rewrite ^/geminabox/(.*) /$1 break;
  proxy_set_header Host $http_host/geminabox/;
  proxy_pass http://127.0.0.1:8205/;
}

I’m trying to run GemInABox behind nginx. The service itself works fine, however on the web display it doesn’t pass static files properly, showing blank html.
From the console, the mistake seems to be that instead of calling example.com/geminabox/master.css, it calls example.com/master.css.
Yet it shows properly if i call 127.0.0.1:8205 in my web browser.

NGINX’s error log:
[error] 5813#0: *272 open() "/usr/share/nginx/html/master.js" failed (2: No such file or directory), client: 123.123.123.10, server: 123.123.123.12, request: "GET /master.js HTTP/1.1", host: "123.123.123.12", referrer: "http://123.123.123.12/geminabox/"
(ips changed)

I’ve looked into some suggestions adding a trailing slash or adding more header options, but none of those worked so far. So i hope it’s something small and obvious that I’m just overlooking.

Update 1

As requested my whole nginx block

user nobody;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
   tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 4096;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80;
        listen       [::]:80;
        server_name  137.226.172.42;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
}

My location file sits in /default.d/

Add your own answers!

Related Questions

WireGuard user authentication

3  Asked on November 29, 2021 by aleksandar-pesic

 

“Cannot set device ring parameters: Operation not supported”

1  Asked on November 29, 2021 by rahrahruby

         

dnsmasq cache NOERROR with ANSWER: 0, AUTHORITY: 0

1  Asked on November 29, 2021 by collin-barrett

   

Unreported 400 Bad Request Errors

0  Asked on November 29, 2021 by resu

 

Multiple commands in Docker CMD directive

7  Asked on November 27, 2021 by vladan

 

Serve two locations under one domain

1  Asked on November 27, 2021 by f-p

 

persistent vti configuration in CentOS

1  Asked on November 27, 2021

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir