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

  • 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.

主站蜘蛛池模板: 奉化市| 来安县| 望都县| 甘孜| 乌恰县| 海盐县| 正镶白旗| 平泉县| 宜章县| 信阳市| 阿城市| 丰原市| 吉安市| 岳阳市| 兴隆县| 固原市| 上林县| 舟曲县| 梨树县| 富阳市| 神池县| 福清市| 达拉特旗| 汉源县| 斗六市| 大名县| 顺义区| 宁强县| 夹江县| 蕉岭县| 衡水市| 宣恩县| 广平县| 莱西市| 尼木县| 翁牛特旗| 建水县| 永和县| 鲜城| 泗水县| 东方市|