Simple nginx configuration to launch wordpress site
server { server_name yourdomain.com; root /var/www/wp; # path to wordpress index index.php; gzip on; # enable gzip compression 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; # disable hidden files } location ~* /(?:uploads|files)/.*.php$ { deny all; # disable uploaded scripts } 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; # static caching } 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; } }
Similar Posts:
- php 7.4 + nginx quick start on Windows 10 / Server 2012 / 2016 / 2019
- how to secure nginx http traffic to upstream servers
- how to setup FusionAuth server with nginx and ssl
- how to use VestaCP with Node.JS support.
- Better logging format for nginx proxy_pass
975
Hey would you mind letting me know which web host you’re
working with? I’ve loaded your blog in 3 different
browsers and I must say this blog loads a lot faster then most.
Can you suggest a good internet hosting provider at a fair price?
Thanks a lot, I appreciate it!