All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
82 views

nginx rewrite should be a loop

Is chatGPT bullsh!ttn me, or am I missing something obvious? This is my question: I have an nginx location block like this: location / { location ~ \.html { # First send it back to ...
asimovwasright's user avatar
0 votes
1 answer
24 views

Need equivalent .htaccess rule in apache just like nginx so I can get everything in URL

I have a VPS where I am using nginx and uses following to do URL rewriting. location / { try_files $uri $uri/ /index.php?$args; } Then I simply go to index.php and use the following code to get ...
Frank Martin's user avatar
0 votes
1 answer
154 views

HOW Check Url Parametr and Redirect with Nginx rewrite

I want to check if a parameter is present in a url in nginx and then rewrite. How can i do that? For e.g if url is http://website.com/search/node/item123/loc=33 then redirect to http://website.com/...
Bijan Zand's user avatar
2 votes
1 answer
226 views

How Check Url Parametr and Redirect with Nginx

I want to check if a parameter is present in a url in nginx and then rewrite.How can i do that? For e.g if url is http://website.com/Cat-8/ID-1/Ads-4-3?page=1 then redirect user to http://website.com/...
Bijan Zand's user avatar
1 vote
1 answer
94 views

how redirect to specific after word with nginx rewrite

I'm sure this has been asked before, but I can't find a solution that works. A website has switched CMS services, and i want after ?page= page redirect to main content ! on nginx and with rewrite I ...
Bijan Zand's user avatar
1 vote
1 answer
69 views

How to remove amp word from center of url

I removed Amp Module from our site and I need to remove amp word from center of all of urls. Using Nginx Web server for example : mysite.com/shirt/nike?amp=1&product_list_dir=asc&...
peyman peymani's user avatar
1 vote
1 answer
61 views

Target app assets not loaded with nginx proxy_pass

I have a basic nginx proxy running on http://127.0.0.1:8080. This is the nginx.conf: events {} http { server { listen 8080; server_name 127.0.0.1; rewrite_log on; ...
Asmaa's user avatar
  • 31
0 votes
0 answers
36 views

Mask Url from path to subdomain using NGINX

I want to achieve url rewrite as such: https://documentation.domain.com/login to https://app.domain.com/login https://api.domain.com/login to https://app.domain.com/login , any sudomain with url {...
Jason The Dynamite's user avatar
0 votes
0 answers
96 views

NGINX Rewrite path to subdomain with cloudflare results in Too many redirects

I want to achieve url rewrite as such: https://documentation.domain.com/login to https://app.domain.com/login https://api.domain.com/login to https://app.domain.com/login , any sudomain with url {...
Jason The Dynamite's user avatar
0 votes
1 answer
37 views

How to rewrite www to non www in nginx

I found a couple of other serverfault questions where rewrite www to non-www in nginx was answered, however it seems like with the nginx config my webdock.io server has the solutions I have tried seem ...
skribe's user avatar
  • 105
0 votes
0 answers
22 views

How do I rewrite a fake filename into a GET argument for a hidden file on nginx?

How to turn example.com/search.php?q=QUERY into example.com/s/QUERY So that when you visit example.com/s/QUERY it executes example.com/search.php?q=QUERY And also how do you block access to example....
johnnyApplePRNG's user avatar
0 votes
1 answer
59 views

nginx config for SEO friendly Laravel setup

I wasn't able to find an immediate solution to the 3rd item, below, so once I'd worked it out, I thought it would be helpful to post my general config for Laravel in order to help others searching for ...
zoot's user avatar
  • 267
0 votes
0 answers
81 views

How to rewrite a file URL in a reverse proxy upstream to a host local path?

I setup a Nginx reverse proxy virtual host as below: location / { proxy_pass http://127.0.0.1:8082; proxy_set_header Host $host:$server_port; proxy_set_header X-Forwarded-Host $server_name;...
Vincent's user avatar
0 votes
0 answers
246 views

Kubernetes Nginx Ingress url rewrite for dynamic id in url

I'm running a Kubernetes cluster on Azure Kubernetes Service(Aks). Currently, I'm having a service called product-service and I have exposed it to the outside using Nginx Ingress. My current ingress ...
Pasindu Prabhashitha's user avatar
0 votes
1 answer
92 views

nginx rewrite both .php and .html

Have 2 rules for working files with (html, php) prefix and without. But working only first rule. If first php, second with html prefix show not found. if (!-e $request_filename){ rewrite ^/([^\.]+)...
oim's user avatar
  • 1
2 votes
1 answer
334 views

nginx: How to write regex to split URL into host and "everything else"?

I want to map https://www.example.com/Something/SomethingElse/ to https://www.example.com/index.php?/Something/SomethingElse/ So far I understood that I need the location directive in nginx and use ...
Александр Кулагин's user avatar
0 votes
1 answer
549 views

nginx url rewrite regex with special characters

How to write a regex that matches a path node with reserved characters like '+','-' ? for example: https://e.example.com/foo+/bar/file/test.txt need to be re-written as https://e.example.com/bar/file/...
Pahan's user avatar
  • 3
0 votes
0 answers
66 views

NGINX rewrite url with arg

We need to check if a URL contains a specific arg "?___store=en" and then redirect to the same url, but add /en/ after the domain name. But this should be dynamic, because the url is not ...
JGeer's user avatar
  • 113
0 votes
1 answer
49 views

Nginx custom 301 rewrite

I am struggling to find how to write this scenario 301 redirect to nginx: https://mydomain/$ to be converted https://mydomain/en_us/$ Actually I need to add "en_us" just after mydomain and ...
G. G.'s user avatar
  • 143
1 vote
1 answer
285 views

Nginx how to make redirect by removing part of URL with regex mask?

I need to redirect from URL like example.com/some-urltext-nav.html to example.com/some-urltext.html (remove "-nav" only). I've tried some regular expressions in server block like rewrite ^.*?...
Oleksandr's user avatar
0 votes
1 answer
363 views

How to redirect URLs containing random string in Nginx

In my access log I've got random a lot of query strings, it is something like this https://example.com/?rJWLuVR1=JXhedT2G https://example.com/?JuntjUsc=kfLAIJCx https://example.com/?...
user3195859's user avatar
0 votes
0 answers
361 views

How to remove part of an URL in Nginx?

I want to automatically remove /feed from the URL For Example: example.com/blog/something/feed/ to example.com/blog/something/ Could someone tell me how to do this in Nginx?
Subhash's user avatar
  • 171
0 votes
0 answers
157 views

Nginx : Get last value of URL

I am posting here because I have not found an answer to the following problem. I have the following url: https://www.example.com/archives/5852555.pdf and I need to keep only 5852555.pdf to pass this ...
outstore's user avatar
0 votes
0 answers
148 views

Nginx rewrite - not working - convert from htaccess

I have a .htaccess file and I'm trying to convert it to an NGINX URL Rewrite configuration. Unfortunately, none of the available converters help. Every time I get either a 403 error or 'No input file ...
Przemo Memo's user avatar
0 votes
1 answer
10k views

Nginx http to http redirect 400 The plain HTTP request was sent to HTTPS port

i have an app that is exposed at http on port http://app1.internal.example.com:8080 and https on port https://app1.internal.example.com:8443 so i have the 80 and 443 nginx server block to help ...
uberrebu's user avatar
  • 503
0 votes
1 answer
62 views

how to setting nginx extension wildcard

i want to hiding my extension like .php but it's not only to hiding, if i enter the index.do nginx rewrite to index.php but, url address must be the same (index.do) In summary, what I specifically ...
Boot Re's user avatar
0 votes
1 answer
32 views

NGINX Crossed Mappings

I appear to have a issue with my mappings in my NGINX configuration. The first mapping handles UserID or Username. The second mapping overrides the first mapping, and is forcing token in place of id ...
Jonny's user avatar
  • 1
0 votes
1 answer
660 views

nginx redirect multiple server names with non-standard port in url

I have an endpoint like https://app1.company.com:5555 and will like to be able to browse the website with the port number in the url for all pages and also be able to browse without the port number at ...
uberrebu's user avatar
  • 503
2 votes
0 answers
242 views

Rewrite cname host mapping url paths with nginx

There is currently an app that is using cname host mapping with a third party app the hostname for the third party app is mycompany.partner.com and the current cname host map under my domain help....
uberrebu's user avatar
  • 503
0 votes
0 answers
329 views

Issue with Nginx Url Rewrite /Redirect

For new site config I tried NGINX rewriting for the blog plan and keep the paths the same, just redirect from 'www.' to 'blog.'. and plan for RSpace API and CME have been configured and the ALB. www....
santosh baruah's user avatar
0 votes
1 answer
237 views

nginx append query parameter with encrypted value to a react application

I want to send the DN field from the client certificate ($ssl_client_s_dn), but I want to send it encrypted. In the question nginx append query parameter to a react application it is explained how to ...
Ximo Dante's user avatar
0 votes
1 answer
231 views

nginx remove all query parameters and add a new one to a react application

I want to discard all the query parameters and add a new one (for instance DN=$ssl_client_s_dn). The reason is to prevent the client from sending this query parameter. Replacing the value of the query ...
Ximo Dante's user avatar
1 vote
1 answer
732 views

nginx append query parameter to a react application

I am a beginner in Nginx and I want to append a query parameter to the URL (for instance myid) in order to serve a react application. I am using nginx/1.18.0 (Ubuntu) There are similar questions like: ...
Ximo Dante's user avatar
0 votes
1 answer
437 views

Nginx - fastcgi cache not working for rewrite enabled php page

I've been trying to figure out why Im failing to achieve fastcgi caching for a rewrite rule applied php page. While all other request wonderfully cache, the rewrite ^(.+)/special/?$ /inc/special....
TheMonkeyKing's user avatar
0 votes
0 answers
103 views

nginx rewrite complex urls

I need some help to rewrite the following url and I didn't find the solution: I need to rewrite the url: http://ip_address/number/file to: http://ip_address/only_last_three(number)/file-number where ...
Santiago Alberch's user avatar
1 vote
1 answer
981 views

nginx rewriting static asset to different path

I have a main app located at root: /app/web. Then another app within a subdirectory - /app/web/second. Pages are located in /app/web/second/<env>/page. Assets are located in /app/web/second/<...
Allan Thomas's user avatar
1 vote
2 answers
297 views

Nginx rewrite to specific part of requested uri

I am quite new to nginx rewrite concept and I can't figure out how to rewrite the requested_uri to a specific Uri. I am trying to make rewrites to specific js files. For example, I have this ...
dimpap's user avatar
  • 11
0 votes
1 answer
78 views

rewrite url from text cache file otherwise not found call php file

way to call cache files generated before example url : example.com/story/2022/07/18/2192547/ from /home/example/2192547.txt that's easy but i need it like if 2192547.txt found use rewrite ^/story/([0-...
Mikel Tawfik's user avatar
0 votes
1 answer
248 views

How to hide page name in rewrite rules in Nginx

I am trying to hide page name from url using rewrite rules in Nginx. but its not working, please see the below example Actual url: https://super30.net/referal.php?uid=999999 Needed url: https://...
Asesha George's user avatar
0 votes
1 answer
28 views

Trying to get Nginx to transform a url ie from example.com/$uri example.com/path/$uri

when tries to access example.com without the "path" (example.com/path) I meed Nginx to add the path to the url, if it already there then ignore the rewrite. Any assistance would be welcome. ...
antonf's user avatar
  • 1
0 votes
1 answer
849 views

Regex to remove certain patterns from urls

So i've tried this multiple times but to no avail. Basically, what I am trying to do is check if the URL has a certain language locale and remove it and do a 301 redirect to the parent url without the ...
user3321266's user avatar
1 vote
0 answers
143 views

NGINX should not change the URL in the Browser Address Bar

I hope you can help me on the following matter. I have NGINX Running and want to forward to .html (virtual pages) to index.php?view=$args without changing the URL, which is shown in the Browser ...
Berlinux's user avatar
1 vote
0 answers
1k views

nginx proxy_pass change target domain in requests and responses

My Problem is: I have a server with an internal domain name service.internal.example.com which redirects all clients asking for another domain to its FQDN https://service.internal.example.com. This ...
Brolf's user avatar
  • 11
0 votes
1 answer
135 views

Nginx Redict without modifying url

I want to make a redirection from one domain to another but from one page only. Example: https://domainA.com/site/page to https://domainB.com/site/page In nginx I put: location /site { ...
Isaac Palacio's user avatar
0 votes
1 answer
503 views

nginx reverse proxy IP_adr/1881 to localhost:1881 proxy_pass

I have read this post, and try many thing but i have issue with rewrite regex. here I have many node.js processes as backends with always different port to access. With Nginx reverse proxy in the same ...
dinastar66's user avatar
1 vote
1 answer
2k views

rewrite rules from apache to nginx

I have a problem with this... I'm using free hosting for giving a demo to my future buyers of my own cms. The hosting is hubuhost.com, they are supporting the last version of php 8.1. The problem is ...
pok4's user avatar
  • 13
0 votes
1 answer
425 views

Nginx ingress - escape characters

I have the following ingress conf that is exposed via nodePort 32100. When I call (curl) the URL [1] which contains parenthesis, I get HTTP 500 error. But when I call the URL [2] which contains no ...
user515576's user avatar
0 votes
0 answers
213 views

rewrite rule nginx for everything in a domain

I'd like to make a rewrite of my domain name.domain.tld to another URL. I managed to do this but if I type name.domain.tld/dashboard or anything after the tld I still get the content like without the ...
Iron Dude's user avatar
0 votes
1 answer
428 views

nginx - Attempt to redirect path with variable internally fails

i would like to redirect the request to a file from /path/to/file/content?path=file.pdf to /new/path/to/file/file.pdf under the same domain. I tried simple rewrite rules or like this. location ~ ^/...
Christian's user avatar
0 votes
1 answer
732 views

Why can I write one set of URLs but not others with NGINX?

I've set up NGINX, version 1.18.0, as reverse proxy for my Apache Superset 1.4.0 installation. I'm trying to capture some URL patterns, and rewrite them by adding standalone=1 at the end. The ...
Emre Sevinç's user avatar

1
2 3 4 5
19