nginx 설정 템 플 릿
5849 단어 nginx
[root@localhost nginx]# cd conf/
[root@localhost conf]# ll
36
drwxr-xr-x. 2 richmail richmail 4096 2 4 19:31 conf.d
-rwxr-xr-x. 1 richmail richmail 2837 2 3 23:25 koi-utf
-rwxr-xr-x. 1 richmail richmail 2223 2 3 23:25 koi-win
-rwxr-xr-x. 1 richmail richmail 3463 2 3 23:25 mime.types
-rwxr-xr-x. 1 richmail richmail 2710 2 3 17:40 nginx.conf
-rwxr-xr-x. 1 richmail richmail 1675 2 3 23:25 privkey.pem
-rwxr-xr-x. 1 richmail richmail 4412 2 3 23:25 server.pem
-rwxr-xr-x. 1 richmail richmail 3610 2 3 23:25 win-utf
[root@localhost conf]# less nginx.conf
user richmail richmail;
#worker_processes 4;
#worker_cpu_affinity 0001 0010 0100 1000;
worker_rlimit_nofile 65535;
pid /home/richmail/nginx/logs/nginx.pid;
events {
use epoll;
worker_connections 256;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
sendfile on;
tcp_nopush on;
keepalive_timeout 30;
tcp_nodelay on;
log_format acc '$remote_addr - $remote_user [$time_local] "$request" '
'$status $upstream_response_time $body_bytes_sent "$http_referer" "$sent_http_location"'
'"$http_user_agent" "$http_x_forwarded_for"';
gzip on;
gzip_comp_level 2;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript;
gzip_proxied any;
gzip_vary on;
proxy_cache_path /home/richmail/nginx/cache levels=1:2 keys_zone=tmp_cache:1024m inactive=20m max_size=1024m;
#proxy_set_header X-Forwarded-Proto https;
add_header X-Frame-Options SAMEORIGIN;
#add_header Cache-Control no-store;
server {
listen 80;
server_name _;
access_log /home/richmail/logs/xx.nginx.log acc;
error_log /home/richmail/logs/xx.nginx.err info;
root /home/richmail/nginx/html;
proxy_intercept_errors on;
error_page 500 /error.html;
error_page 404 /404.html;
user richmail richmail;
#worker_processes 4;
#worker_cpu_affinity 0001 0010 0100 1000;
worker_rlimit_nofile 65535;
pid /home/richmail/nginx/logs/nginx.pid;
events {
use epoll;
worker_connections 256;
}
http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
sendfile on;
tcp_nopush on;
keepalive_timeout 30;
tcp_nodelay on;
log_format acc '$remote_addr - $remote_user [$time_local] "$request" '
'$status $upstream_response_time $body_bytes_sent "$http_referer" "$sent_http_location"'
'"$http_user_agent" "$http_x_forwarded_for"';
gzip on;
gzip_comp_level 2;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript;
gzip_proxied any;
gzip_vary on;
proxy_cache_path /home/richmail/nginx/cache levels=1:2 keys_zone=tmp_cache:1024m inactive=20m max_size=1024m;
#proxy_set_header X-Forwarded-Proto https;
add_header X-Frame-Options SAMEORIGIN;
#add_header Cache-Control no-store;
server {
listen 80;
server_name _;
access_log /home/richmail/logs/xx.nginx.log acc;
error_log /home/richmail/logs/xx.nginx.err info;
root /home/richmail/nginx/html;
proxy_intercept_errors on;
error_page 500 /error.html;
error_page 404 /404.html;
error_page 404 /404.html;
}
server {
listen 80;
server_name webnote.com 127.0.0.1 192.168.34.92;
access_log /home/richmail/logs/mail.nginx.log acc;
error_log /home/richmail/logs/mail.nginx.err info;
proxy_intercept_errors on;
error_page 500 502 503 504 /error.html;
error_page 404 /404.html;
error_page 403 =404 /forbidden.gif;
if ($request_method !~* GET|HEAD|POST) {
return 400;
}
include conf.d/note.conf;
}
server {
listen 443;
server_name webnote.com 127.0.0.1 192.168.34.92;
access_log /home/richmail/logs/mailssl.nginx.log acc;
error_log /home/richmail/logs/mailssl.nginx.err info;
proxy_intercept_errors on;
error_page 500 502 503 504 /error.html;
error_page 404 /404.html;
error_page 403 =404 /forbidden.gif;
if ($request_method !~* GET|HEAD|POST) {
return 400;
}
add_header Cache-Control no-store;
add_header Pragma: no-cache;
ssl on;
ssl_certificate server.pem;
ssl_certificate_key privkey.pem;
include conf.d/note.conf;
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
간단! Certbot을 사용하여 웹 사이트를 SSL(HTTPS)화하는 방법초보자가 인프라 주위를 정돈하는 것은 매우 어렵습니다. 이번은 사이트를 간단하게 SSL화(HTTP에서 HTTPS통신)로 변경하는 방법을 소개합니다! 이번에는 소프트웨어 시스템 Nginx CentOS7 의 환경에서 S...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.