脚本部署Nginx配置文件

This commit is contained in:
LyLme 2023-12-26 02:11:48 +08:00
parent 43189c584a
commit 53b3eec057

View File

@ -0,0 +1,44 @@
server {
listen <port> default_server;
server_name <domain>;
absolute_redirect off;
root /var/www/html;
location / {
index index.html index.htm index.php;
}
location ~ \.php$ {
fastcgi_pass spage-php74:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ ^/(\.user.ini|\.htaccess|\.git) {
return 404;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 12h;
error_log off;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 12h;
error_log off;
access_log off;
}
}
server {
#内网访问
listen 80;
server_name _;
root /var/www/html;
location / {
index index.html index.htm index.php;
}
location ~ \.php$ {
fastcgi_pass spage-php74:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}