内容简介:Nginx多站点/域名配置
假设有两个域名,joker.moe和blog.joker.moe,要为每个域名建立一个站点http://joker.moe访问/www目录,http://blog.joker.moe访问/www/bolog目录。
在nginx.conf同目录下新建文件夹vhosts,在nginx.conf里添加 include vhosts/*.conf;
,如:
worker_processes auto;
events {
use epoll;
......
}
http
{
include mime.types;
default_type application/octet-stream;
......
server
{
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name _;
index index.html index.htm index.php;
root /www;
location ~ .*\.php(\/.*)*$ {
root /www;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
......
}
include vhosts/*.conf;
}
在vhosts目录里新建blog.joker.moe.conf,当然可以随便命名,后缀是 .conf
就可以了。一下为参考内容
server
{
listen 80;
#listen [::]:80;
server_name blog.joker.moe ;
index index.html index.htm index.php default.html default.htm default.php;
root /www/blog.joker.moe;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
location ~ .*\.php(\/.*)*$ {
root /www/blog.joker.moe;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
......
}
最后重启nginx即可。
标签:nginx
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 七牛云配置HTTPS站点小记
- Django 配置多站点多域名
- 如何使用 Apache Web 服务器配置多个站点
- 生成根证书CA及签发子证书及配置站点实践
- 创建自签名 SSL 数字证书以配置开发测试环境站点 HTTPS 访问
- [站点记录] 在站点上启用 Let's Encrypt 通配符证书
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Intel汇编语言程序设计
Kip Irvine / 电子工业出版社 / 2007-9-1 / 61.00元
《国外计算机科学教材系列•Intel汇编语言程序设计(第5版)》全面细致地讲述了汇编语言程序设计的各个方面。从微处理器体系结构、工作机制到指令集;从最基本的编译器链器的使用到高级过程、结构和宏的使用;从用纯汇编编写程序到用C/C++等最新编译器与汇编的混合接口编程;从16位实模式下BIOS、DOS实模式文本及图形程序设计到32位保护模式的Windows程序设计;从磁盘基础知识到Intel指令编码、......一起来看看 《Intel汇编语言程序设计》 这本书的介绍吧!