我正在尝试加载NGINX 1.15.3,但它不会响应。这是一个全新安装,但我什至看不到默认的NGINX html页面。在我使用MariaDB 10.3和PHP7.3创建的另一个AWS实例上,此配置运行良好,在错误日志中也没有得到任何结果。
随附的是我的dafault.conf文件
server {
server_name testing.mydomain.com;
root /usr/share/nginx/html;
index index.html index.php;
http2_push_preload on;
location / {
try_files $uri $uri/ /index.php?$args;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
}
location = /xmlrpc.php {
deny all;
}
location = /favicon.ico { log_not_found off; access_log off; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
location ~ /\.ht {
deny all;
}
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
}
还附在nginx配置文件中
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Basic Settings
tcp_nopush on;
tcp_nodelay on;
types_hash_max_size 2048;
server_tokens off;
ignore_invalid_headers on;
client_max_body_size 20M;
fastcgi_max_temp_file_size 0;
fastcgi_buffers 128 2048k;
fastcgi_buffer_size 2048k;
# Decrease default timeouts to drop slow clients
keepalive_timeout 40s;
send_timeout 20s;
client_header_timeout 20s;
client_body_timeout 20s;
reset_timedout_connection on;
server_names_hash_bucket_size 64;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Limits
limit_req_zone $binary_remote_addr zone=dos_attack:20m rate=30r/m;
gzip on;
gzip_disable "msie6";
gzip_vary off;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 1000;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/atom+xml;
# Virtual Host Configs
include /etc/nginx/sites-enabled/*;
# Only allow save protocols
ssl_protocols TLSv1.2 TLSv1.3;
# Prefer server side protocols for SSLv3 and TLSv1
# ssl_prefer_server_ciphers on;
# ssl_ciphers "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256";
# SSL session cache
ssl_session_cache shared:SSL:5m;
ssl_session_timeout 1h;
ssl_buffer_size 4k;
ssl_session_tickets on;
# Problem with sect571 and ecdhe ciphers
ssl_ecdh_curve secp384r1:secp521r1;
add_header Content-Security-Policy "";
add_header Strict-Transport-Security "max-age=15768000;includeSubDomains;preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Public-Key-Pins '';
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 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}