question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Location fails on second, third,...

See original GitHub issue

Great project, nice interface and function, thank you!

I have a single proxy host domain configured with two custom locations, aka /path(s). The first path works/is redirected as expected. The second, third, … return a 404. I’ve included my docker-compose.yml, ./data/nginx/proxy_host/1.conf snippet, and screenshots.

I’m not sure what it is I might be missing in the configuration or if indeed it’s a bug. I’m a little unclear on the Use 1.1.1.1/path for sub-folder forwarding statement under the /path field. Obviously your wouldn’t use 1.1.1.1, or other DNS. I tried using the subdomain.domain.com but that failed as I would have expected since it would create a loop. I’m also a little confused on the destination port setting of the proxy host since I’m redirecting using a custom location/path. No port setting I’ve tried resolves the issue and no port is not an option as it’s required.

Thank you

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image? YES
version: "3"
services:
  app:
    image: jc21/nginx-proxy-manager:latest
    restart: always
    ports:
      # Public HTTP Port:
      - '80:80'
      # Public HTTPS Port:
      - '443:443'
      # Admin Web Port:
      - '81:81'
    environment:
      # Uncomment this if IPv6 is not enabled on your host
      DISABLE_IPV6: 'true'
    volumes:
      # Make sure this config.json file exists as per instructions above:
      - ${USERDIR}/nginx_proxy_manager/config.json:/app/config/production.json
      - ${USERDIR}/nginx_proxy_manager/data:/data
      - ${USERDIR}/nginx_proxy_manager/letsencrypt:/etc/letsencrypt
    depends_on:
      - db
  db:
    image: mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: <obfuscated>
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'ngx_user'
      MYSQL_PASSWORD: <obfuscated>
    volumes:
      - ${USERDIR}/nginx_proxy_manager/data/mysql:/var/lib/mysql
  • Are you sure you’re not using someone else’s docker image? YES

  • If having problems with Lets Encrypt, have you made absolutely sure your site is accessible from outside of your network?

Describe the bug The first custom location works as expected. The second, third, … fail with a 404

  • What version of Nginx Proxy Manager is reported on the login page? 2.7.1

To Reproduce Steps to reproduce the behavior:

  1. Enter a custom location for a domain
  2. Navigate to the “custom location” aka /path in my browser’s address bar
  3. See the 404 error

Expected behavior

  1. After creating the Custom Location navigating to custom location, aka /path and have page displayed

Screenshots image

image image image image image image image image

snippet from ./data/nginx/proxy_host/1.conf

#...
  location /smokeping {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_pass       http://10.10.0.173:9001;

  }

  location /dockerui {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_pass       http://10.10.0.173:9000;
    
  }
#...

Operating System Ubuntu 20.04.1 Docker version 19.03.13, build 4484c46d9d docker-compose version 1.27.4 HP Elite 8300 i5-3470S, 16GB Ram, 1TB SSD

./data/logs/proxy_host-1.log

[05/Dec/2020:20:17:33 +0000] - 404 404 - GET https <obfuscated>.com "/dockerui" [Client 10.10.0.1] [Length 19] [Gzip -] [Sent-to 10.10.0.173] "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36" "-"

No relative info from

data/logs/error.log
data/logs/default_host.log
data/logs/default.log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
JBlondcommented, Aug 10, 2022

@federicoalvarez-github What works is

Edit proxy host -> Advanced -> Custom Nginx Configuration

location /dockerui/ {
    rewrite /dockerui/(.*) /$1  break;
    proxy_pass  http://10.10.0.173:9000;
}

location / {
    # Proxy!
    include conf.d/include/proxy.conf;
}
0reactions
dmr138commented, Oct 30, 2022

adding the above mentioned code to the advanced tab added this towards the top of my config file above all my other custom locations

location /portainer/ { rewrite /portainer/(.*) /$1 break; proxy_pass https://192.168.1.6:9443; }

From custom locations ui set the path as /portainer/ and fill in the rest like you normally would. then click the gear icon and in the custom section add rewrite /portainer/(.*) /$1 break;.

that might do the trick without needing to use the advanced tab and should add the same thing to your config as listed above but I have not tested this yet.

(I did not use the location / { # Proxy! include conf.d/include/proxy.conf line as I already had that location block in my config file.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in adding location service to android custom ROM
For adding a location service in android , you should add package name of location service in following file in AOSP build tree...
Read more >
Setting up your locations - Shopify Help Center
Location apps are listed in the Locations settings in the App and custom fulfillment locations section. Although these apps are treated as locations, ......
Read more >
Error Messages | Maps JavaScript API - Google Developers
This page describes the error messages that can be returned by the Maps JavaScript API. The Maps JavaScript API writes error and warning...
Read more >
Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
VPC Network Peering | Google Cloud
Google Cloud VPC Network Peering connects two Virtual Private Cloud (VPC) ... Peered networks can exchange custom static routes using internal TCP/UDP load ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found