Skip to content

Instantly share code, notes, and snippets.

@alexlabarces
Created February 24, 2014 19:10
Show Gist options
  • Save alexlabarces/9194839 to your computer and use it in GitHub Desktop.
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.
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