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.

rewrite directive is no longer working

See original GitHub issue

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you’re not using someone else’s docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug

the rewrite directive has no effect when put into the advanced tab for example
rewrite ^/about$ /preferences last; this works on LSIO SWAG, but doesn’t work on NPM.

this issue started around the beginning of November, maybe something changed in OpenResty ? or a regression in v2.9.11+ ?

Nginx Proxy Manager Version

v2.9.12

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘any proxy host’
  2. Click on ‘advanced’
  3. put a rewrite directive like rewrite ^/about$ /preferences last;
  4. test it and it won’t work.

Expected behavior

the rewrite directive should work, and rewrite URLs as instructed.

Screenshots

Operating System

Debian 11/docker

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
diwu1989commented, Nov 14, 2021

Tried on the github-pr-1578 image and rewrites also dont work. I have a wss custom location that sends /ws to a different port, and need to rewrite /ws to root /

0reactions
brtwrstcommented, Aug 2, 2022

Can confirm that my custom locations are breaking after editing and re-saving. with the current :latest version Made it work again by using the “add custom nginx config here at own risk” option of the custom locations.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rewrite directive is no longer working · Issue #1584 - GitHub
9.11+ ? ... Steps to reproduce the behavior: Go to 'any proxy host'; Click on 'advanced'; put a rewrite directive like rewrite ^/about$...
Read more >
Nginx rewrite module not working - Server Fault
The issue here is that rewrite directive destination part is always relative to the root directory. So, assuming your setup is like this:....
Read more >
Module ngx_http_rewrite_module - Nginx.org
The ngx_http_rewrite_module module is used to change request URI using PCRE regular expressions, return redirects, and conditionally select configurations.
Read more >
How to Create NGINX Rewrite Rules
In this blog post, we discuss how to create NGINX rewrite rules (the same methods work for both NGINX Plus and the open...
Read more >
RewriteEngine doesn't work outside <VirtualHost> Directive ...
1 Answer 1 ... The reason why it appears that the Rewrite* directives do not work in the server configuration and need to...
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