[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;
}
}
分享到:
相关推荐
nginx 配置模板,正常项目中使用的一些配置。 server { listen 80; server_name www.test.com; charset utf-8; access_log logs/access.log; root "E:/front"; proxy_set_header Host $host; set $uid "-"; ...
nginx-configuration, 创建和管理 Nginx 配置的实用程序和模板 Nginx 配置针对各种用例的Nginx 配置模板集合,主要用于运行 PHP web应用程序。安装sudo git clone ...
通用Nginx配置模板 Nginx模板 这是用于混合设置的我的个人Nginx模板。 我正在尝试将此nginx配置为通用; 无论是wordpress还是static html等等。 我的目标是启用缓存,SEO友好的URL,Cloudflare支持,添加h5bp,ngx_...
nginx1.21.5 nginx.conf配置文件
1)配置nginx 在对应server中添加状态信息页面location,启动状态信息服务 location /server-status { stub_status on; allow 127.0.0.1; deny all; access_log off; } 测试示例:...
wordpress-nginx:WordPress特定的Nginx配置模板和最佳实践!
增加设置多个nginx配置模板,可以实现负载均衡、自动配置虚拟主机等高级的nginx的功能 nginx配置模板为nginxconf/template/domainlocalconf.tpl #该项目使用帮助 由于我在windows上编译的,暂时没有找到交叉编译...
nginx反向代理跨域问题解决的配置文件,很好地窝窝网。
nginxWebUI是一款图形化管理nginx配置得工具, ... nginxWebUI并不能涵盖nginx所有功能, 但能覆盖nginx日常90%的功能使用配置, 平台没有涵盖到的nginx配置项, 可以使用自定义参数模板, 在conf文件中生成配置独特的参数。
nginx.conf配置文件,反向代理,负载均衡--轮询、权重、IPHASH等
我只是添加新的配置文件来覆盖默认的NGINX配置。 根据nginx.conf文件,NGINX在启动时会包含模块配置文件(/etc/nginx/modules-enabled/*.conf),然后是特定的配置摘要(/etc/nginx/conf.d/ * .conf),用于管理...
此容器允许您使用 nginx 配置中的 Docker 链接设置的环境变量。 用法 将您的配置挂载到/etc/nginx/sites-templates ,最好是只读的。 要捕获日志,请将可写目录挂载到/var/log/nginx 。 HTTP (80) 和 HTTPS (443) ...
bara还有一个概念就是Nginx的配置文件模板,Nginx的配置文件是根据这个模板动态创建的,这个模板如果有{{upstream}}占位符,则会被bara系统自动根据运行中的容器来替换为一个upstream列表。 标签:bara
4. Nginx upstream 信息放在 mysql, 根据模板生成upstream.conf, 机器列表实时从服务管理系统获取; 5. 支持 ip_hash 字段, online 字段表示 是否在线, 不为1 不生成配置; 6. 支持增加域名, 自动生成配置文件并 push ...
nginx-pv.yaml,nginx-set.yaml等等
nginx-boilerplate 包含一系列的 Nginx 配置模板,值得参考。 特性: 常用的基于 include 的配置结构 优化默认参数 连接和请求限制设置 后端响应缓存 各种预定义的 location 高级日志 标签...
windows下nginx服务器的配置,rtmp模板已编译,亲测可正常推流。解压后运行nginx.exe文件即可。windows下nginx服务器的配置,rtmp模板已编译,亲测可正常推流。
以上简单描述提供了部署Nginx的基本步骤,但根据具体情况可能需要进一步配置Nginx,如设置虚拟主机、SSL证书、反向代理、负载均衡等。确保根据实际需求和安全要求进行适当的配置和调整。同时,为保障系统安全,建议...
带有nginx和consul模板的Docker映像,用于从consul动态更新其配置文件。 该镜像基于构建。 如何使用这张图片? docker镜像是通过自动构建的。 在Dockerfile中 FROM yeasy/nginx-consul-template:latest 本地跑步 $...
log_format main '$remote_addr - $remote_user [$time_local] "$request" '其他子项配置模板。