```conf
worker_processes auto;
worker_shutdown_timeout 30s;
worker_rlimit_core 50M;
working_directory /tmp/;
worker_rlimit_nofile 10240;
events
{
worker_connections 10240;
worker_aio_requests 1024;
}
http
{
include mime.types;
default_type application/octet-stream;
charset utf-8;
autoindex off;
autoindex_exact_size on;
autoindex_localtime on;
# 啟用 gzip 壓縮,自定義配置文件
include gzip.conf;
sendfile on;
# 在響應頭中隱藏 Nginx 版本號
server_tokens off;
# 隱藏fastcgi的頭信息,如:php-fpm
fastcgi_hide_header X-Powered-By;
# 隱藏反向代理服務器頭信息,如:httpd
proxy_hide_header X-Powered-By;
# nginx 啟用 TLSv1.3 加密傳輸協議
ssl_protocols TLSv1.3;
# 解決點擊劫持漏洞,頁面只能被本站頁面嵌入到 iframe 或者 frame 中
add_header X-Frame-Options sameorigin always;
# 加載請求限制, http 區域
include limit_req_http.conf;
server
{
listen 80;
server_name localhost;
root /server/default;
access_log /server/logs/nginx/localhost.log;
index index.php;
# 站點僅允許溫州電信ip段訪問
allow 39.186.0.0/16;
allow 60.181.0.0/16;
deny all;
# 設置站點僅至允許 GET、POST 請求
if ($request_method !~* GET|POST)
{
return 403;
}
# 啟用緩存設置,自定義配置文件
include cache.conf;
location / {
# 加載請求限制,server區域,需要結合http區塊
include limit_req_server.conf;
}
location ~ \.php
{
fastcgi_pass unix:/server/run/php/default.sock;
include fastcgi.conf;
}
location ~ /\.
{
deny all;
}
}
include /server/sites/*.conf;
}
```
- Nginx 篇
- php 多版本
- 主配置文件
- 靜態站點配置模版
- tp6 站點的模版
- php 單版本
- 主配置文件
- 靜態站點配置模版
- tp6 站點的模版
- 靜態文件啟用壓縮
- 限制請求-http 塊
- 限制請求-server 塊
- 緩存配置文件
- tp6 站點的 fastcgi 模版
- MariaDB 篇
- MariaDB 主配置文件
- MariaDB 服務端子配置文件
- MariaDB 密鑰
- redis 篇
- sqlite3 篇
- php
- PHP 單版本篇
- PHP 多版本篇(new)
- php-fpm 主配置文件(php 單版本)
- php-fpm 工作池配置文件(php 單版本)
- '8.0(php 多版本)'
- php-fpm 主配置文件
- php-fpm 工作池進程配置文件
- '8.1(php 多版本)'
- php-fpm 主配置文件
- php-fpm 工作池進程配置文件
- service
- Nginx 系統單元文件
- MariaDB 系統單元文件
- redis 系統單元文件
- php-fpm 系統單元文件(php 單版本)
- phpfpm-8.0 系統單元文件(php 多版本)
- phpfpm-8.1 系統單元文件(php 多版本)
- vsftpd 篇
- pam-mysql 配置文件
- vsftpd 配置文件
- sh
- 刪除 lnmp 目錄腳本
- 創建 lnmp 目錄腳本
- 解壓 lnmp 安裝包腳本