Answers for "nginx redirect / to /something"

4

redirect nginx 301

server { 
listen 80; 
server_name serverdomain.com;
     return 301 http://serverdomain.com$request_uri; 
}
Posted by: Guest on April-30-2021
0

nginx redirect to non www

server {
    server_name www.example.com;
    return 301 $scheme://example.com$request_uri;
}
Posted by: Guest on June-08-2020

Browse Popular Code Answers by Language