Skip to main content
Share Your Experience: Take the 2024 Developer Survey
2 votes
Accepted

Nginx subdomain to subdomain redirect not working

NGINX docs mention that for the server_name directive: the digital references can easily be overwritten Thus you should use named captures. Also, since you're performing site-wide redirect without ...
Danila Vershinin's user avatar
2 votes
Accepted

Path not excluded by mod_rewrite config

You are missing the leading /, i.e., you are using !^\.well-known instead of !^/\.well-known. It would probably be best to add the tailing /, too, to match the contents on that directory alone: !^/\....
Esa Jokinen's user avatar
  • 50.1k
2 votes
Accepted

Application actions based on URL

With a "redirect" on a URL you instruct a site visitor to make a new request with the target URL your webserver provides. When the request for target URL is made, you can't reliably differ ...
HBruijn's user avatar
  • 80.7k
2 votes
Accepted

Is it better to redirect root to www or www to root?

The www. prefix is a remnant from the glorious old 90s when you had a single machine for each service, like FTP, WWW, SMTP etc. and had to use a separate hostname for each one. The apex/bare domain ...
AlexD's user avatar
  • 10.4k
1 vote
Accepted

Nginx: only shows website when port is specified

/etc/nginx/conf.d implies the directory layout used by RHEL and derivatives. /etc/nginx/sites-available implies the directory layout used by Debian and derivatives. To get a definitive picture of what ...
symcbean's user avatar
  • 22.6k
1 vote

in iptables redirect unknown mac clients using --to-destination 192.168.0.30

When you do a hairpin redirect, you need to change not only the destination address, but also the source address. Because if not, the target server will try to reply directly to the source, while the ...
pepoluan's user avatar
  • 5,148
1 vote
Accepted

www to non-www redirection not working on Nginx

What you have is a redirect from http://www.example.com to https://example.com. In addition you will need a redirect from https://www.example.com to example.com, with certificates to match.
vidarlo's user avatar
  • 9,610
1 vote

nginx refuses to redirect all 404 pages to my index.html

Woops, I figured it out. This page answers my question. Problem was this line include /etc/nginx/conf.d/*.conf; Commented it out, and my actual config was then used! I also adjusted the conf file to ...
Dave's user avatar
  • 346
1 vote

Path not excluded by mod_rewrite config

I would try to do it more simple. With mod_alias loaded (no need for mod_rewrite in your example, I tend to not use mod_rewrite unless it is really necessary) and also use directory not location for ...
Daniel Ferradal's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible