Ubuntu下Nginx多站点配置
sudo vi /etc/nginx/sites-available/default
2.将server代码复制,修改listen端口,文件路径和server_name
server {
listen 8011; #配置端口号
listen [::]:8011; #配置端口号
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don’t use them in a production server!
#
# include snippets/snakeoil.conf;
root /XXX/XXX/XXX; #配置文件路径
# Add index.php to the list if you are using PHP
index index.html index.htm index.php;
server_name XXX.XXX; #配置服务器名
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
3.重启服务器.
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });sudo service nginx restart
以上就介绍了Ubuntu下Nginx多站点配置,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
推荐阅读
-
Ubuntu下Nginx多站点配置
-
图文详解Ubuntu下安装配置Mysql教程
-
ubuntu下的nginx+php+mysql安装配置
-
windows下nginx + php配置
-
nginx下的重定向配置
-
ubuntu下配置nginx+php+mysql详解,ubuntunginx_PHP教程
-
Ubuntu 8.10下快速架设Nginx2.6+PHP5.2.6+MySQL5.0
-
windows下nginx调试时的技巧 博客分类: confwindowsnginx配置技巧 Windowsnginx配置技巧conf
-
windows下nginx调试时的技巧 博客分类: confwindowsnginx配置技巧 Windowsnginx配置技巧conf
-
Ubuntu下快速部署安装 Nginx + PHP + MySQL 笔记