0
NGINXが設定されているVPS用の設定を同僚から継承しました。私は現在httpとhttpsを使って動的コンテンツを提供することができますが、httpsが接続タイプとして指定されている場合、画像、javascript、cssなどの静的コンテンツはロードされません(404として表示)。NGINXのhttps静的コンテンツ
configを継承したので、httpディレクティブの下でnginx.confにロケーションブロックを追加し、使用するルートを指定する際にNGINXの独自のガイドを失敗しましたが、どこから始めたらいいかわかりません。
http{
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location/{
root /var/www/;
}
}
私も、しかし、私は、コンテンツを提供することができ、他に何に私の同僚ノートの任意のドキュメントを見つけることができませんよ、無効nginxのと同じ動作を得るのですか。
正しい方向のポインターがあれば幸いです!
このを通じてトロールuser nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
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;
autoindex off;
map $scheme $fastcgi_https { ## Detect when HTTPS is used
default off;
https on;
}
client_header_timeout 3000;
client_body_timeout 3000;
fastcgi_read_timeout 3000;
client_max_body_size 32m;
fastcgi_buffers 8 128k;
fastcgi_buffer_size 128k;
keepalive_timeout 10;
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
}
'http'の' location'は無効です。あなたのサーバの設定を表示する –
元の投稿にnginx.confを追加しました –
'server'ブロックが表示されません。それらは '/etc/nginx/conf.d/*。conf;'ファイルにあるべきです。 –