单台机器动静分离
作者:互联网
1.配置
[root@web01 /code]# cat /etc/nginx/conf.d/linux.blog.com.conf server { listen 80; server_name linux.blog.com; root /code/wordpress; location / { index index.php; } location ~* \.(jpg|png)$ { root /code/pic; root /code/wordpress; } location ~* \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
2.创建目录
[root@web01 /code]# mkdir /code/pic
3.做软连接
[root@web01 /code]# ln -s /code/wordpress/wp-content /code/pic
标签:code,分离,pic,单台,动静,wordpress,location,root,fastcgi 来源: https://www.cnblogs.com/chenlifan/p/13617236.html