ThinkPHP 在阿里云上的nginx.config配置實例詳解
具體代碼如下所示:
# 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;
events {
worker_connections 1024;
}
http {
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 /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;
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 / {
#try_files $uri $uri/ /index.php;
root /usr/share/nginx/html;
index index.php index.html index.htm;
if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; }
}
# redirect server error pages to the static page /40x.html
#
error_page 404 /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
}
總結(jié)
以上所述是小編給大家介紹的ThinkPHP 在阿里云上的nginx.config配置實例詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
- 借用nginx.vim工具進行語法高亮和格式化配置nginx.conf文件
- Nginx服務(wù)器配置HTTPS nginx.config 配置文件(教程)
- Nginx配置文件nginx.conf詳細說明
- Nginx配置文件(nginx.conf)配置詳解(總結(jié))
- 詳解Nginx服務(wù)器中的nginx.conf配置文件
- Nginx配置文件nginx.conf的常用配置方法
- 比較完整的Nginx配置文件nginx.conf常用參數(shù)中文詳解
- Nginx的nginx.conf配置文件中文注釋說明
- nginx配置文件nginx.conf中文注釋說明
- nginx.conf配置文件結(jié)構(gòu)小結(jié)
相關(guān)文章
yii2框架中使用下拉菜單的自動搜索yii-widget-select2實例分析
這篇文章主要介紹了yii2框架中使用下拉菜單的自動搜索yii-widget-select2的方法,介紹了yii-widget-select2的下載,安裝及具體使用技巧,需要的朋友可以參考下2016-01-01
使用phpstorm和xdebug實現(xiàn)遠程調(diào)試的方法
vs的斷點調(diào)試功能很強大有木有,能查看所有變量有木有。php調(diào)試很麻煩有木有,echo,var_dump寫得你想吐了有木有。想體驗一下ide調(diào)試的快感嗎?那就來使用xdebug吧2015-12-12
淺談PHP攔截器之__set()與__get()的理解與使用方法
下面小編就為大家?guī)硪黄獪\談PHP攔截器之__set()與__get()的理解與使用方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-10-10
Yii使用ajax驗證顯示錯誤messagebox的解決方法
這篇文章主要介紹了Yii使用ajax驗證顯示錯誤messagebox的解決方法,可以自行設(shè)置Ajax提示信息的方式,是非常實用的技巧,需要的朋友可以參考下2014-12-12
Swoole4.4協(xié)程搶占式調(diào)度器詳解
這篇文章主要介紹了Swoole4.4協(xié)程搶占式調(diào)度器詳解,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2019-05-05
關(guān)于laravel5.5的定時任務(wù)詳解(demo)
今天小編就為大家分享一篇關(guān)于laravel5.5的定時任務(wù)詳解(demo),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-10-10
Laravel 在views中加載公共頁面的實現(xiàn)代碼
今天小編就為大家分享一篇Laravel 在views中加載公共頁面的實現(xiàn)代碼,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-10-10
Laravel框架控制器的middleware中間件用法分析
這篇文章主要介紹了Laravel框架控制器的middleware中間件用法,結(jié)合具體案例形式分析了Laravel框架控制器的middleware中間件相關(guān)使用步驟、操作技巧與注意事項,需要的朋友可以參考下2019-09-09

