Last active
April 8, 2017 15:49
-
-
Save MiguelTVMS/b4c90079e20400e64acd860cd0d57672 to your computer and use it in GitHub Desktop.
Rodando NG_PageSpeed & Nginx utilizando Docker - nginx.conf
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
worker_processes 1; | |
error_log logs/error.log %%NGX_LOGLEVEL%%; | |
pid logs/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
'$status $body_bytes_sent "$http_referer" ' | |
'"$http_user_agent" "$http_x_forwarded_for"'; | |
access_log logs/access.log main; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
upstream %%NGX_UPSTREAM_NAME%% { | |
server %%NGX_UPSTREAM_SERVER%%; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
pagespeed %%NPS_ENABLED%%; | |
pagespeed FileCachePath /var/ngx_pagespeed_cache; | |
pagespeed LowercaseHtmlNames %%NPS_LOWERCASEHTMLNAMES%%; | |
pagespeed EnableFilters %%NPS_ENABLEFILTERS%%; | |
pagespeed RespectVary %%NPS_RESPECTVARY%%; | |
pagespeed DisableRewriteOnNoTransform %%NPS_DISABLEREWRITEONNOTRANSFORM%%; | |
pagespeed ModifyCachingHeaders %%NPS_MODIFYCACHINGHEADERS%%; | |
pagespeed XHeaderValue "%%NPS_XHEADERVALUE%%"; | |
access_log logs/host.access.log main; | |
location / { | |
subs_filter %%NGX_UPSTREAM_NAME%% $host; | |
proxy_pass http://%%NGX_UPSTREAM_NAME%%$uri$is_args$args; | |
} | |
location /robots.txt { | |
root html; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment