Skip to content

Instantly share code, notes, and snippets.

@intsdev
Last active July 11, 2020 18:20
Show Gist options
  • Save intsdev/78716cacc6a63dd821e9b322b7564658 to your computer and use it in GitHub Desktop.
Save intsdev/78716cacc6a63dd821e9b322b7564658 to your computer and use it in GitHub Desktop.
Nginx config
server {
listen 80;
server_name mydomain.com;
# To remove the trailing slash on all URLs:
rewrite ^/(.*)/$ /$1 permanent;
# To remove the trailing slash on one page
# rewrite ^/page/$ /page permanent;
location / {
# rewrite rule
try_files $uri $uri /index.php?cmsquerystring=$args;
}
# proxy sitename.com/images to example.com
location /images/ {
proxy_pass https://example.com/;
proxy_hide_header Strict-Transport-Security;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment