美文网首页
nginx配置文件

nginx配置文件

作者: 浪人残风 | 来源:发表于2022-02-13 16:16 被阅读0次

For more information on configuration, see:

* Official English Documentation: http://nginx.org/en/docs/

* Official Russian Documentation: http://nginx.org/ru/docs/

user nginx;

worker_processes auto;

error_log /var/log/nginx/error.log;

pid /run/nginx.pid;

Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.

include /usr/share/nginx/modules/*.conf;

events {
worker_connections 1024;
}

http {
log_format main 'remote_addr -remote_user [time_local] "request" '
'statusbody_bytes_sent "http_referer" ' '"http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile            on;
tcp_nopush          on;
tcp_nodelay         on;
keepalive_timeout   65;
types_hash_max_size 2048;

include /etc/nginx/mime.types;

include       mime.types;
default_type        application/octet-stream;

# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;

server {

listen 80 default_server;

listen [::]:80 default_server;

server_name _;

root /usr/share/nginx/html;

# Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;

location / {

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

 server {
    listen 8090;
    server_name _;
    location / {
        root /usr/local/var/www;
        try_files $uri $uri/ @router;
        index index.html index.htm;
    }
}
 server {
    listen 443 ssl;
    server_name _;
    ssl_certificate      /Users/jack/Downloads/5883641__digiin.net_nginx/5883641__digiin.net.pem;
    ssl_certificate_key  /Users/jack/Downloads/5883641__digiin.net_nginx/5883641__digiin.net.key;
    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;


    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;
    location /pay {
       proxy_pass https://localhost:8080;
    }
    location /get {
        rewrite ^/get(.*) http://192.168.11.112:8081/$1 break;
    }
    location /wechatPay {
        proxy_pass https://localhost:8081;
    }
}
upstream front_api1 {
    server 192.168.11.112:8081 weight=1;
}
server {
    listen 8088;
server_name _;
    location / {
        proxy_pass http://front_api1;
        proxy_set_header Host $host;
        proxy_set_header  X-Real-IP  $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_next_upstream error timeout invalid_header;
        add_header Access-Control-Allow-Origin *;            add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept";
        add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
    }
}
upstream front_mgr_api1{
    server 127.0.0.1:9081 weight=1;
}
server {
    listen 9080;
    server_name _;
    location / {
        proxy_pass http://front_mgr_api1;
    }
}

Settings for a TLS enabled server.

server {

listen 443 ssl http2 default_server;

listen [::]:443 ssl http2 default_server;

server_name _;

root /usr/share/nginx/html;

ssl_certificate "/etc/pki/nginx/server.crt";

ssl_certificate_key "/etc/pki/nginx/private/server.key";

ssl_session_cache shared:SSL:1m;

ssl_session_timeout 10m;

ssl_ciphers HIGH:!aNULL:!MD5;

ssl_prefer_server_ciphers on;

# Load configuration files for the default server block.

include /etc/nginx/default.d/*.conf;

location / {

}

error_page 404 /404.html;

location = /40x.html {

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

}

}

}

rtmp {
server {
listen 1935;
application live {
live on;
}

    application live1 {
        live on;
    }
    
    application live2 {
        live on;
    }
    
}

}

相关文章

  • 第二讲 Nginx模块详解

    本章要点 Nginx 配置文件结构 各个模块的详解 2.1 Nginx配置文件结构 Nginx的配置文件nginx...

  • Nginx配置文件详解

    Nginx配置文件nginx.conf详解 nginx.conf nginx技术一--配置文件nginx.conf...

  • 应用程序常用命令

    nginx: nginx启动:nginx -c nginx配置文件地址检查配置文件是否正确:nginx -t重启n...

  • nginx(五)nginx cmd

    nginx cmd 1、启动nginx start nginx 2、修改配置文件并生效 测试nginx配置文件是否...

  • Nginx配置文件nginx.conf详解和nginx的变量规则

    Nginx配置文件nginx.conf详解 Nginx 总的 配置文件 位置 /usr/local/nginx/c...

  • Nginx使用

    Nginx [toc] nginx命令 参数 Nginx启动 通过指定配置文件启动 配置文件语法检查 Nginx配...

  • nginx配置文件

    nginx配置文件nginx配置文件详解一、nginx配置文件 启动子进程程序默认用户 user nobody;...

  • Nginx 打印body体内容

    Nginx 打印body体内容,修改nginx配置文件nginx.conf 重新加载配置文件 nginx body...

  • nginx(二)

    在修改配置文件后,检查 nginx 配置文件语法是否正确:nginx -t 重新启动 nginx: nginx -...

  • Nginx yum安装目录

    日志切割配置文件/etc/logrotate.d/nginx主要配置文件/etc/nginx/etc/nginx/...

网友评论

      本文标题:nginx配置文件

      本文链接:https://www.haomeiwen.com/subject/uxoflrtx.html