Last active
April 18, 2017 03:15
-
-
Save mborodov/43b8aaf336698d58069028426d530667 to your computer and use it in GitHub Desktop.
Nginx Bitrix vhost ssl redirect exclude robots.txt and sitemap.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set $http 0; | |
if ($request_uri = '/robots.txt') { | |
set $http 1; | |
} | |
if ($request_uri = '/sitemap.xml') { | |
set $http 1; | |
} | |
if ($http = 1) { | |
rewrite ^ /robots.txt break; | |
rewrite ^ /sitemap.xml break; | |
} | |
if ($http = 0) { | |
rewrite ^(.*)$ https://$host$1 permanent; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment