Created
December 7, 2018 09:20
-
-
Save artemrogov/1eb359b341ce1b39934e2334c42c881e to your computer and use it in GitHub Desktop.
wordpress.conf settings for nginx wordpress
This file contains hidden or 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
server { | |
server_name wp.com; | |
root /var/www/wp; # путь к WP | |
index index.php; | |
gzip on; # включаем сжатие gzip | |
gzip_disable "msie6"; | |
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; | |
location ~ /\. { | |
deny all; # запрет для скрытых файлов | |
} | |
location ~* /(?:uploads|files)/.*\.php$ { | |
deny all; # запрет для загруженных скриптов | |
} | |
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { | |
access_log off; | |
log_not_found off; | |
expires max; # кеширование статики | |
} | |
location / { | |
try_files $uri $uri/ /index.php?$args; # permalinks | |
} | |
location ~ \.php$ { | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment