All Questions
626
questions
0
votes
1
answer
31
views
nginx redirect subdirectory
rewrite ^/faq/(.*)$ /faq/$1 redirect;
I would like to redirect domain.tld/faq/* to domain.tld/faq/
Unfortunately, this leads to an endless loop.
Background: There was the FAQ url and very many other ...
0
votes
1
answer
56
views
nginx redirects with changed response code
I am trying to redirect any location that gives 404 to the front page and change the response code to 302.
According to nginx documentation this should be possible?
https://nginx.org/en/docs/http/...
1
vote
1
answer
30
views
Redirect removing sufixes after 3 URL segmentes in Nginx
This is the URL that I need to remove the last segment (?order=asc)
https://www.example.com/segment_1/segment_2/page/the_number_goes_here/?order?asc
This is the code I'm trying:
location ~ ^/([^/]+)/(...
0
votes
1
answer
46
views
Special redirect NGINX Wordpress removing last segment
I need some guidance on how to redirect this the proper way...
I have a site on nginx and a bunch of malformed URL's (crawled by Search Console) that I need to redirect with 301.
My CMS is Wordpress ...
-1
votes
1
answer
112
views
nginx refuses to redirect all 404 pages to my index.html
I want Nginx to redirect all pages that are 404 to my index.html.
This nginx is running as a container. Yes I have confirmed nginx is actually being reached as the docker-compose log output shows the ...
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&...
1
vote
1
answer
38
views
Nginx subdomain to subdomain redirect not working
The config below redirects to .another-domain.com with empty subdomain name. What am I doing wrong?
server {
server_name ~^(\w+)\.domain\.com$;
location / {
rewrite ^ $scheme://$1.another-...
0
votes
1
answer
103
views
How redirect ANY site not found in Hestia to another server - Nginx proxy manager
I want: if ANY site not found in (Hestia 192.168.0.37
server) then redirected (Nginx proxy manager 192.168.0.36)
Given:
Hestia server 192.168.0.37
Nginx proxy manager 192.168.0.36
Site for test ...
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 {...
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 {...
0
votes
0
answers
28
views
Nginx missing trailing slash redirects to the wrong url behind proxy
We use an nginx webserver behind an nginx proxy. When i try to browse a subpath, the nginx backend webserver (something.example.local) appends a trailing slash behind the url (301 redirect) -as ...
0
votes
0
answers
23
views
Pass requests for specified hosts throw VM
I have VPN that restrict all internet except inner resources. I don't like it and i want to install VM, connect it to VPN and redirect all requests for specified hosts to VM and get back answer.
Is ...
0
votes
0
answers
31
views
Learning reason of incorrect redirect in Nginx
There's a web app url of which may vary - it's either .com or my..com depending on if a user is logged or not.
However, there's an element on the main page (that can be accessed via .com or my..com) ...
0
votes
0
answers
73
views
Nginx Redirecting Single Question Mark Request to Originaly URI
I'm trying to redirect URI's ending in a single question mark to the same URI with the single question mark removed. Running nginx/1.21.6
Here's an example.
Original Request:
https://domian.com/...
-1
votes
1
answer
217
views
Cloudflare DNS keeps redirecting to a wrong site on the same server
I have a strange DNS setting glitch here.
We are rebuilding and migrating two old sites to a new VPS server. They coexist now as below. We use Cloudflare DNS (NO reverse proxy).
Site A: aaa.example....
0
votes
0
answers
35
views
GeoIP-specifing nginx redirect for multiple servers
I need redirection based on country code I get from GeoIP (ngx_http_geoip2_module), but as I see, I can't use map because I need different conditions and destination URLs for different server ...
0
votes
0
answers
115
views
Nginx Server Block Not Redirecting Properly
I've just recently swapped over to nginx from apache2, and it seems to be handling load times much better. However, I've now lost access to my forum subdomain. Whenever I goto my forum's subdomain, it ...
0
votes
0
answers
61
views
Redirect route to a totally new one with same domain Nginx
The website with this route Domain.tld/faq.php=?lang=en&id=121 need to redirect to Domain.tld/some/121?lang=en not only id=121 but any id with the old route to be redirected to the new route.
...
0
votes
0
answers
41
views
NGINX - redirect userdir to another domain
I had an apache virtualhost config that redirects "http://host.domain.com/~userdir" to another host:
RewriteRule ^/~(.+) http://anotherhost.domain.com/~$1 [R,L]
But I'm having trouble ...
0
votes
1
answer
234
views
How can I configure Nginx to redirect all traffic to my website to the HTTPS WWW version and HTTPS version for subs with a consistent URL structure
What I am trying to do is to have some clean redirects and don't make the content from the server available everywhere like is available via https://server-ip https://non-www and https://www-version
I ...
0
votes
0
answers
89
views
Site with subdomains in redirect loop - Nginx configuration Issues
this is the website (the website also have subdomains)
nginx configuration:
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to ...
1
vote
2
answers
1k
views
nginx reverse proxy with docker containers and specific nested locations
I would like to set up nginx as a reverse proxy with multiple apps on docker containers permanently residing under specific locations, e.g.:
https://sub.example.com/wiki
https://sub.example.com/app1
...
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 ...
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 ^.*?...
0
votes
0
answers
49
views
Using nginx proxy to redirect the content to another website
I'm using Ubuntu 18.04 & Nginx for my websites.
I need help with the following question.
Let's say (on the same server) I have the following:
/home/website1/public_html/image_abc.webp
When people ...
0
votes
0
answers
203
views
Nginx - redirect subdirectory to a different domain without changing URL
We've set up a Matrix-Synapse chat server at the root of one domain, and we'd like to redirect the /element subdirectory to the Element client hosted at another domain, but without changing the ...
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?
1
vote
0
answers
29
views
nginx dynamic forwarding requests coming from users
I have a backend application that binds users with server ports (I attribute a random available TCP port to each connected user)
Using NGINX, I want to redirect all requests coming from a user -...
1
vote
1
answer
499
views
Change upstream response from 302 to 301 in nginx
I have a Django app as an upstream using Gunicorn in nginx, and that app sometimes sent me back a 302 with a Location. And that it's perfectly fine.
We can't touch Django's code but colleagues need ...
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 ...
0
votes
1
answer
235
views
nginx: [warn] server name has suspicious symbols with long domain redirect
What is the best way in Nginx to redirect two Long domains URLS, I would like to configure a redirect between two domains like this:
I'm sure this has been asked before, but I can't find a solution ...
0
votes
1
answer
155
views
Any way Nginx can resolve a CNAME (or look up a URL elsewhere) and then redirect to the result?
I've got an AWS API Gateway endpoint with a URL like this:
https://xxxxxxxxxx-vpce-09572222209cd2305.execute-api.us-west-1.amazonaws.com
I want to create an easy to remember alias for that name that ...
0
votes
1
answer
780
views
Redirect all URLs to other (external) site except for one path?
I have a working website (http://www.example.com) that (uses PHP-FPM) for which I want to redirect all incoming trafic to an URL on another website (ttps://www.other-example.com/foo.html) except one ...
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....
0
votes
1
answer
1k
views
How to redirect specific page to another url on nginx?
I am using matomo hosted on this sample url:
https://testmatomo.azureapp.com
Since I want to secure the admin page of matomo, I setup a Cloudflare Access w/ Zero Trust for that specific domain ...
0
votes
2
answers
46
views
How do I redirect "old.foo.com/foo" to "new.foo.com/foo" with a NGINX K8S ingress, without breaking cert-manager?
In my K8S ingress config, I'm trying to redirect from (for example) old.mywebsite.com to new.mywebsite.com.
I can do this with the nginx.ingress.kubernetes.io/permanent-redirect annotation, but ...
0
votes
1
answer
392
views
redirect http to https in nginx load balancer
we have a setup of nginx load balancer where we configure our servers.
Now, the requirement came like all the dns that we are maintaining should be only allowed with https.
Example: tempserver.com is ...
0
votes
1
answer
39
views
Nginx, three identical vhost configs, one works, the other two got too many redirects
I got three websites on my server. My mainpage gamenotify.net works well. My other two are getting to many redirects between www and non-www url. My vhost files are identical to my mainpage. I just ...
0
votes
1
answer
463
views
nginx allow sending redirect from app to client
I am trying to redirect a user back to my mobile-app after successful login. (linking back to the app)
For this, I send a 307 response with this link: exp://192.168.178.33:19000?steamId=...
1
vote
1
answer
707
views
Nginx redirects to ```https://server_name/ ```URL instead of ```https://server_name/projectname/``` , after changing the URL from http to https
I have a couple of URLs like https://server_name/projectname/, now the problem is if I type this URL on the browser, Django (or Nginx) redirects me to https://server_name/, which does not exist. ...
0
votes
0
answers
413
views
Nginx server under load balancer, when /folder is found redirects to /folder/ but changes the host url
I have nginx server setup in google cloud. Server is being accessed from a host domain through gcloud pointing.
Like this:
https://server.com/test/ points to instance group with one of instances with ...
0
votes
1
answer
6k
views
nginx config reverse proxy lose basepath on redirect without slash
i have the following nginx configs to redirect the url path to it's perspective services
server {
listen 80;
server_name abc.com;
location = favicon.ico { access_log off; log_not_found off ...
0
votes
2
answers
858
views
301 redirect url based off of a category in the url
Does anyone know how to redirect a url that contains a parent category of a product? Basically I want to redirect a ton of products to a simple landing page that I created, so instead of making ...
0
votes
1
answer
1k
views
Setup A Default Redirect In Nginx
I need a way to redirect clients when no existing path is defined. When I put a return 301 config in, nginx seems to ignore any location configs. It redirects everything.
The hostname in the ...
0
votes
1
answer
658
views
Make nginx redirect to HTTPS even with competing location regex
I have the following configuration inside a nginx server {...} block:
location /someapp {
if ( $https != "on" ) {
return 301 https://$server_name$request_uri;
}
location ~ \....
0
votes
1
answer
773
views
Nginx reverse-proxy pass front-end application matching url from HTTPS to HTTP
I everyone. I'm very new to Nginx. My situation is like this.
I have a Php application which that handles both backend and front-end, and also I have another ReactJs application as a micro-frontend ...
0
votes
0
answers
426
views
Rewrite rule not woking on Nginx
I want to redirect from /sitemap.xml to /sitemap_index.xml.
So, I contacted the plugin developer and received the following rewrite rule.
# START Nginx Rewrites for Rank Math Sitemaps
rewrite ^...
2
votes
1
answer
393
views
How to make nginx use request port for try_files redirect?
I have nginx listening on port 80 in a docker container which maps the port to 8080.
When I go to http://example.com:8080/test nginx redirects me to http://example.com/test/ while I would expect it to ...
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 ...
0
votes
1
answer
611
views
nginx: Redirection from old to new git base URL
I would like to redirect the old base url of git repositories. I use the following code:
location ~ ^/scm/git/(.*) {
return 301 /scm/repo/git/$1;
}
In the browser, the redirection works fine, but ...