nginx相关配置的内容

1.nginx.conf的内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#user  nobody;
worker_processes  1;
 
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
 
#pid        logs/nginx.pid;
 
 
events {
    worker_connections  1024;
}
 
 
http {
    include       /usr/local/nginx/conf/mime.types;
    default_type  application/octet-stream;
 
#---------------------------------------------------------
    charset  utf-8;
 
    server_names_hash_bucket_size 128;
    client_header_buffer_size 2k;
    large_client_header_buffers 4 4k;
    client_max_body_size 100m;
    #client_max_body_size 1g;
#---------------------------------------------------------
 
    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  /usr/local/nginx/logs/access.log  main;
 
    sendfile        on;
    #tcp_nopush     on;
 
    keepalive_timeout  65;
 
    server_tokens      off;
 
#--------------------------------------------------------------------------------
    gzip  on;
    gzip_min_length  1k;
    gzip_buffers     4 16k;
    gzip_http_version 1.0;
    gzip_comp_level 2;
    gzip_types       text/plain application/x-javascript text/css application/xml;
    gzip_vary on;
#--------------------------------------------------------------------------------
    include /usr/local/nginx/conf/vconf/*.conf;
 
}

  2.api.conf的内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#server {
## http时使用该配置
#   listen       80;
#   server_name  www.xzbj.xyz;
#
#   location / {
##            root   html;
##            index  index.html index.htm;
#   proxy_pass http://www.xzbj.xyzxx:8080;
#   }
#
#location = /favicon.ico {
#       log_not_found off;
#       access_log off;
#   }
#
#   #error_page  404              /404.html;
#
#   # redirect server error pages to the static page /50x.html
#   #
#   error_page   500 502 503 504  /50x.html;
#   location = /50x.html {
#       root   html;
#   }
#}
server {
    listen 80;
    server_name www.xzbj.xyz;
    rewrite ^(.*)$ https://${server_name}$1 permanent;
}  
server {
    listen 443;
    server_name localhost;
    ssl on;
    root html;
    index index.html index.htm;
    ssl_certificate   /usr/local/nginx/conf/ssl/1_www.xzbj.xyz_bundle.crt;
    ssl_certificate_key  /usr/local/nginx/conf/ssl/2_www.xzbj.xyz.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    location / {
        #root html;
        #index index.html index.htm;
#       proxy_pass http://www.xzbj.xyzxx:8080;
        proxy_pass http://ali.drip;             #指向upstream---进行nginx分发处理
    }
}

server8080.conf的内容

1
2
3
4
5
6
7
8
9
10
11
12
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;
 
#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}

upstream.conf 的内容

1
2
3
4
5
6
upstream ali.drip {
    #hash $remote_addr consistent;
    # 转发的目的地址和端口
    server 118.190.146.81:9990 weight=5 max_fails=3 fail_timeout=30s;
    server 118.190.146.81:9991 weight=5 max_fails=3 fail_timeout=30s;
}

  

posted @   天妖姥爷  阅读(211)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示