首页 > 系统相关 >Nginx config generator All In One

Nginx config generator All In One

时间:2023-04-28 23:11:48浏览次数:42  
标签:log generator ssl xyz etc Nginx nginx xgqfrms config

Nginx config generator All In One

NGINXConfig, Nginx 配置配置高性能、安全、稳定的 Nginx 服务器的最简单方法。

https://github.com/digitalocean/nginxconfig.io

image

https://www.digitalocean.com/community/tools/nginx?global.app.lang=zhCN

demos

tar

chmod

image

openssl

chown

image

sed

tee

image

systemctl

image

/etc/nginx/nginx.conf

# Generated by nginxconfig.io
# See nginxconfig.txt for the configuration share link

user                 www-data;
pid                  /run/nginx.pid;
worker_processes     auto;
worker_rlimit_nofile 65535;

# Load modules
include              /etc/nginx/modules-enabled/*.conf;

events {
    multi_accept       on;
    worker_connections 65535;
}

http {
    charset                utf-8;
    sendfile               on;
    tcp_nopush             on;
    tcp_nodelay            on;
    server_tokens          off;
    log_not_found          off;
    types_hash_max_size    2048;
    types_hash_bucket_size 64;
    client_max_body_size   16M;

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

    # Logging
    access_log             off;
    error_log              /dev/null;

    # SSL
    ssl_session_timeout    1d;
    ssl_session_cache      shared:SSL:10m;
    ssl_session_tickets    off;

    # Diffie-Hellman parameter for DHE ciphersuites
    ssl_dhparam            /etc/nginx/dhparam.pem;

    # Mozilla Intermediate configuration
    ssl_protocols          TLSv1.2 TLSv1.3;
    ssl_ciphers            ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;

    # OCSP Stapling
    ssl_stapling           on;
    ssl_stapling_verify    on;
    resolver               1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
    resolver_timeout       2s;

    # Load configs
    include                /etc/nginx/conf.d/*.conf;
    include                /etc/nginx/sites-enabled/*;
}

/etc/nginx/sites-available/xgqfrms.xyz.conf

server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             xgqfrms.xyz;
    set                     $base /var/www/xgqfrms.xyz;
    root                    $base/public;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/xgqfrms.xyz/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/xgqfrms.xyz/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/xgqfrms.xyz/chain.pem;

    # security
    include                 nginxconfig.io/security.conf;

    # logging
    access_log              /var/log/nginx/access.log combined buffer=512k flush=1m;
    error_log               /var/log/nginx/error.log warn;

    # index.php
    index                   index.php;

    # index.php fallback
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # additional config
    include nginxconfig.io/general.conf;

    # handle .php
    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php-fpm.sock;
        include      nginxconfig.io/php_fastcgi.conf;
    }
}

# subdomains redirect
server {
    listen                  443 ssl http2;
    listen                  [::]:443 ssl http2;
    server_name             *.xgqfrms.xyz;

    # SSL
    ssl_certificate         /etc/letsencrypt/live/xgqfrms.xyz/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/xgqfrms.xyz/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/xgqfrms.xyz/chain.pem;
    return                  301 https://xgqfrms.xyz$request_uri;
}

# HTTP redirect
server {
    listen      80;
    listen      [::]:80;
    server_name .xgqfrms.xyz;
    include     nginxconfig.io/letsencrypt.conf;

    location / {
        return 301 https://xgqfrms.xyz$request_uri;
    }
}

https://www.digitalocean.com/community/tools/nginx?domains.0.server.domain=xgqfrms.xyz&global.app.lang=zhCN

(

标签:log,generator,ssl,xyz,etc,Nginx,nginx,xgqfrms,config
From: https://www.cnblogs.com/xgqfrms/p/17363365.html

相关文章

  • nginx自定义指定加载配置
    进入 /usr/local/nginx/conf/include目录,创建 nginx.node.conf文件,在里面输入如下代码:upstreamnodejs{server127.0.0.1:3000;#server127.0.0.1:3001;keepalive64;}server{listen80;server_namewww.penguu.compenguu.com;access_lo......
  • Keepalived+Nginx架构配置
    Keepalived介绍keepalived是一个类似于layer3,4,5交换机制的软件,也就是我们平时说的第3层、第4层和第5层交换。Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web服务器从系统中剔除,当web服务器工作正常后Keepa......
  • maven deploy configuration
    inpom.xml,theconfigwillbebelow:<repositories> <repository> <id>com.nomura.xxx</id> <url>http://XXXXXXX:8080/archiva/repository</url> </repository> </repositories> <distributionMana......
  • Linux安装Nginx
    前言:老规矩,linux安装软件的目录都是data目录 1.进入data目录,创建nginx目录并进入该目录cd/datamkdirnginxcdnginx 2.yum在线安装一些基础环境yuminstallpcreyuminstallpcre-develyuminstallzlibyuminstallzlib-develyuminstallopensslyum......
  • mybatis Generator生成代码及使用方式
    为什么要有mybatismybatis是一个Java的ORM框架,ORM的出现就是为了简化开发。最初的开发方式是业务逻辑和数据库查询逻辑是分开的,或者在程序中编写sql语句,或者调用sql存储过程。这样导致思维需要在语言逻辑和sql逻辑之间切换,导致开发效率低下。所以出现了一系列的ORM框......
  • nginx启动服务脚本
    #chkconfig:3456060#!/bin/bash#nginxStartupscriptfortheNginxHTTPServer#itisv.0.0.2version.#chkconfig:-8515#description:Nginxisahigh-performancewebandproxyserver.#Ithasalotoffeatures,butit'snotfo......
  • Unknown run configuration type SpringBootApplicationConfigurationType;Servlet Ser
    UnknownrunconfigurationtypeSpringBootApplicationConfigurationType社区版的idea自己安装插件,去配置大家可分享关于Java微服务相关知识,包括但不限于Java微服务开发经验、架构组成、技术交流、中间件等内容,我们鼓励springcloud架构为基础发散出击,从而达到技术积累的目的,快来沉......
  • 通过yum方式安装Nginx
    Nginx的安装方式有两种分别是:通过Nginx源码(1)通过Nginx源码简单安装 (2)通过Nginx源码复杂安装 使用源码进行简单安装,我们会发现安装的过程比较繁琐,需要提前准备GCC编译器、PCRE兼容正则表达式库、zlib压缩库、OpenSSL安全通信的软件库包,然后才能进行Nginx的安装。这里不做......
  • phpstudy配置nginx跨域请问
    add_headerAccess-Control-Allow-Origin*; add_headerAccess-Control-Allow-Methods'GET,POST,OPTIONS'; add_headerAccess-Control-Allow-Headers'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Cont......
  • nginx+uwsgi+django安装配置
    一、安装Nginxsudoapt-getinstallnginx更改/etc/nginx/sites-enabled/default文件 添加内容:server { listen8080; #server_name127.0.0.1 charsetUTF-8; access_log/var/log/nginx/......