New answers tagged

0 votes

Nginx http redirect to https when https proxy_pass

Single server definition is enough: upstream backend { server 127.0.0.1:8080; # replace with actual address and port } server { listen 80 default_server; listen 443 ssl http2 default_server; ...
Tombart's user avatar
  • 2,173
0 votes

Nginx http redirect to https when https proxy_pass

Try the configuration as mentioned below: # Force all users to https://www.example.com server { listen 80; server_name example.com www.example.com; return 301 https://www.example.com$...
Radheshyam Kori's user avatar
0 votes

Modify Nginx 301 response body

The accepted answer by phbits is great, but there are some pitfalls if you want to apply this to a reverse-proxy situation with proxy_intercept_errors on, so that the error page also replaces errors ...
Fritz's user avatar
  • 136
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
  • 9,849
0 votes

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

You can only have a single A and/or AAAA record at the apex/null/bare domain. That's rather restrictive (you can't do RR-DNS, geo-aware DNS becomes tricky). Since modern browsers will automatically ...
symcbean's user avatar
  • 22.2k

Top 50 recent answers are included