Complete the code to rewrite the URL and stop processing further rewrite directives.
rewrite ^/oldpath$ /newpath [1];The last flag tells nginx to stop processing rewrite directives in the current location and restart the search with the new URI.
Complete the code to rewrite the URL and send a temporary redirect to the client.
rewrite ^/temp$ /newtemp [1];The redirect flag sends a 302 temporary redirect to the client, telling it to request the new URL.
Fix the error in the rewrite rule to send a permanent redirect to the client.
rewrite ^/oldpage$ /newpage [1];The permanent flag sends a 301 permanent redirect to the client, indicating the resource has moved permanently.
Fill both blanks to rewrite the URL internally and stop processing further rewrite directives.
location /example {
rewrite ^/example/(.*)$ /newexample/$1[1];
[2];
}The break flag stops further rewrite processing inside the location. The return 404 directive sends a 404 error response.
Fill all three blanks to rewrite the URL with a permanent redirect and stop processing.
server {
listen 80;
server_name example.com;
location /old {
rewrite ^/old/(.*)$ /new/$1[1];
[2];
[3];
}
}The permanent flag sends a 301 redirect. The return 301 explicitly returns a 301 status. The break stops further rewrite processing.