0
NGINX가 설정된 VPS에 대한 동료의 구성을 상속 받았습니다. 현재 http 및 https를 통해 동적 콘텐츠를 제공 할 수 있지만 https가 연결 유형으로 지정되면 이미지, 자바 스크립트 및 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;'파일들에 들어 있어야만합니다. –