- /usr/local/nginx/sbin/nginx
- /usr/local/nginx/sbin/nginx -s stop
- /usr/local/nginx/sbin/nginx -s reload
- vim /usr/local/nginx/conf/nginx.conf
proxy_pass
#反向代理
# /usr/local/nginx/conf/nginx.conf
user www;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80 default backlog=2048;
listen 443 ssl;
server_name www.fanxian.website;
location / {
root /home/www;
index index.html index.php;
}
location ~ \.php$ {
root /home/www;
fastcgi_index index.php;
try_files $uri = 404;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
server {
listen 80;
server_name pagekit.fanxian.website;
ssl_certificate cacert.pem;
ssl_certificate_key privkey.pem;
location / {
root /home/pagekit;
index index.html index.php;
}
location ~ \.php$ {
root /home/pagekit;
fastcgi_index index.php;
try_files $uri =404;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
server {
listen 80;
server_name css.fanxian.website;
location / {
root /home/css/cssPractise/dist;
index index.html index.htm;
}
}
server{
listen 80;
server_name pdf.fanxian.website;
location /{
root /home/pdf;
index index.html;
}
server{
listen 80;
server_name kelvin.vip;
location / {
#这就叫反向代理吗?反正对这个虚拟主机发请求会转到docker的一个nginx容器
proxy_pass http://127.0.0.1:6666;
}
}
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
网友评论