Created
February 24, 2014 19:10
-
-
Save alexlabarces/9194839 to your computer and use it in GitHub Desktop.
OPTIONAL: Force a redirect of all HTTP traffic to HTTPS when implementing SPDY.
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
log_format http_requests '$remote_addr - [$time_local] "$request" $status "$request_body"'; | |
server { | |
listen 80; | |
server_name example.com; | |
location ^~ / { | |
# Define Custom logs (track all HTTP requests) | |
# =================================================== | |
access_log /var/log/nginx/access.log; | |
access_log /var/log/nginx/http_requests.log http_requests; | |
# For SPDY, force redirect with 301 | |
# =================================================== | |
rewrite ^ https://example.com$request_uri? permanent; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment