官术网_书友最值得收藏!

  • NGINX Cookbook
  • Tim Butler
  • 120字
  • 2021-07-03 00:04:22

How to do it...

In this instance, we're simply using a standalone WordPress site, which would be deployed in many personal and business scenarios. This is the typical deployment for WordPress.

For ease of management, I've created a dedicated config file just for the WordPress site (/etc/nginx/conf.d/wordpress.conf):

server { 
    listen       80; 
    server_name  wordpressdemo.nginxcookbook.com; 
 
    access_log  /var/log/nginx/access.log  combined; 
 
    location / { 
        root   /var/www/html; 
        try_files $uri $uri/ /index.php?$args;     
    } 
 
    location ~ \.php$ { 
        fastcgi_pass unix:/var/run/php7.0-fpm.sock; 
        fastcgi_index index.php; 
        fastcgi_param SCRIPT_FILENAME 
$document_root$fastcgi_script_name; include fastcgi_params; } }

Reload NGINX to read the new configuration file and check your log files if there are any errors. If you're installing WordPress from scratch, you should see the following:

You can complete the WordPress installation if you haven't already.

主站蜘蛛池模板: 双峰县| 宝坻区| 锡林浩特市| 宁津县| 长宁区| 宣汉县| 斗六市| 延寿县| 乌什县| 伊宁县| 合水县| 北宁市| 韶关市| 抚宁县| 会昌县| 乌鲁木齐县| 宜黄县| 衡东县| 南阳市| 绥德县| 灵宝市| 临西县| 松桃| 吴桥县| 宝清县| 防城港市| 常德市| 霍山县| 汉沽区| 广元市| 当涂县| 马公市| 宜宾县| 民和| 沅江市| 台北县| 新余市| 家居| 驻马店市| 盐山县| 城固县|