做这个的目的:
1、看清楚结构目录
2、里面的选项和解释非常多
3、基本上还有很多模块要加入,最好通过这个方式,不然真的是乱的可以
4、server和server名不应该收起来,方便查看
include conf.d/A_Main_Base.conf; # main全局配置段配置文件:正常运行必备的配置:用户
include conf.d/A_Main_processes.conf; # main全局配置段配置文件:优化性能相关的配置
include conf.d/A_Main_Other.conf; # main全局配置段配置文件:用于调试及定位问题相关的配置
include /etc/nginx/modules-enabled/*.conf;
events {
include conf.d/B_Events.conf; # events用户网络连接配置段配置文件
}
http {
include conf.d/C_http_Limit.conf; # 限流配置:文件大小、缓存
include conf.d/C_http_Log.conf; # 日志配置
include conf.d/C_http_Safe.conf; # 安全配置:过滤策略
include conf.d/C_http_Timeout.conf; # 超时配置:请求头、请求体超时
server {
listen 80;
server_name 1.2.3.4; # 域名
rewrite ^(.*)$ https://1.2.3.4$1; # 转443端口
}
server {
listen 443;
server_name 1.2.3.4; # 域名
charset utf-8;
include conf.d/http_1234_443_server_SSL.conf; # SSL配置
include conf.d/http_1234_443_server_Safe.conf; # 安全配置:过滤策略
include conf.d/http_1234_443_server_Log.conf; # 日志配置
include conf.d/http_1234_443_server_Limit.conf; # 限流配置:文件大小、缓存
include conf.d/http_1234_443_server_Timeout.conf; # 超时配置:请求头、请求体超时
location / {
uwsgi_pass 127.0.0.1:8001;
include /etc/nginx/uwsgi_params;
include conf.d/http_1234_443_server_location_uwsgi_Base.conf; # uwsgi_Base配置
include conf.d/http_1234_443_server_location_uwsgi_SSL.conf; # uwsgi_SSL配置
include conf.d/http_1234_443_server_location_uwsgi_cache.conf; # uwsgi_cache配置
}
}
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}