Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://my_domain.com
- https://my_domain.com/
- https://my_domain.com/some_page/
- https://my_domain.com/some_page
- location / {
- # This is what I have tried so far
- rewrite ^(.*)my_domain.com$ $1/ break;
- # Remove trailing double slashes.
- if ($request_uri ~ "^[^?]*?//") {
- rewrite "^" $scheme://$host$uri permanent;
- }
- # Remove trailing slashes.
- rewrite ^/(.*)/$ /$1 permanent;
- # Rewrite page/0 and page/1 from url.
- # rewrite ^/(.*)/page/[01]$ /$1 redirect;
- proxy_pass http://backend_web;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- }
Add Comment
Please, Sign In to add comment