我最近遵循了本教程,在服务器上安装了nginx,打算从中服务两个站点/ URL。
#user nobody;
worker_processes 1;
error_log /var/log/nginx/error.log;
error_log /var/log/nginx/error.log notice;
error_log /var/log/nginx/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# HTTPS server
server {
# listen 443 ssl;
# server_name localhost;
ssl_certificate /opt/splunk/etc/auth/mycerts/signed.crt;
ssl_certificate_key /opt/splunk/etc/auth/mycerts/pvt.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;
# }
include /etc/nginx/sites-enabled/*.conf;
# server_names_hash_bucket_size 64;
}
}
我遵循了本教程https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-on-centos-7
但是似乎无论我做什么我总是得到默认的“ TEST”页面,即使nginx应该使用我的include指令告诉它查看启用了站点的目录(是的,我有两个站点conf文件sym从可用网站链接)
我将继续修改,但是欢迎您提出任何建议:)