接下來咱們重啓服務器就能夠了,重啓的過程當中,你會發現速度很是快;php
安裝配置html
[root@LNAP /]#
rpm -ivh
http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
|
[root@LNAP /]# yum info nginx 已加載插件:fastestmirror Determining fastest mirrors * base: mirrors.yun-idc.com * extras: mirrors.neusoft.edu.cn * updates: mirrors.neusoft.edu.cn base | 3.7 kB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 37 kB 00:00 nginx | 2.9 kB 00:00 nginx/primary_db | 22 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 4.3 MB 00:05 可安裝的軟件包 Name : nginx Arch : x86_64 Version : 1.10.3 Release : 1.el6.ngx Size : 861 k Repo : nginx Summary : High performance web server URL : http://nginx.org/ License : 2-clause BSD-like license Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
: a mail proxy server.
|
[root@LNAP /] #yum install nginx -y
........
.......
.......
[root@LNAP /]#
service nginx start
Starting nginx: [ OK ]
[root@LNAP /]#
chkconfig nginx on //
設置
nginx
開機自啓動
|
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
Thank you for using nginx.
|
server {
listen 443;
server_name localhost; ssl on; ssl_certificate server.crt;
ssl_certificate_key server.key;
# ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
#
這些內容根據本身的需求進行更改
}
|
server {
listen 80;
server_name www.cloud.com;
rewrite ^(.*)$ https://$host$1 permanent;
location / {
root /data/html/phpwind/;
index index.html index.htm index.php;
}
location ~ \.php$ {
root /data/html/phpwind/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/html/phpwind/$fastcgi_script_name;
include fastcgi_params;
}
}
|
server {
listen 443;
server_name www.tcloud.com;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
######SSL#############
ssl on;
ssl_certificate /etc/nginx/cert/discuz.crt;
ssl_certificate_key /etc/nginx/cert/discuz.key;
ssl_protocols SSLv3 SSLv2 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
########SSL模塊##########
location / {
root /data/html/phpwind/;
index index.html index.htm index.php;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
##########PHP模塊###########
location ~ \.php$ {
root /data/html/phpwind/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/html/phpwind/$fastcgi_script_name;
include fastcgi_params;
}
##########PHP#############
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#location ~ /\.ht {
# deny all;
#}
}
|