Nginx配置二級(jí)虛擬目錄訪問(wèn)Laravel后臺(tái)重寫-創(chuàng)新互聯(lián)

案例1
server {
listen 80;
listen 443 ssl http2;
server_name new.api.zentrust.cn;
root /var/www/new.api.zentrust.cn/prod/public;
index index.php index.html index.htm;
etag on;

公司主營(yíng)業(yè)務(wù):做網(wǎng)站、網(wǎng)站設(shè)計(jì)、移動(dòng)網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。成都創(chuàng)新互聯(lián)公司是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來(lái)驚喜。成都創(chuàng)新互聯(lián)公司推出觀山湖免費(fèi)做網(wǎng)站回饋大家。
gzip on;
gzip_vary on;
gzip_http_version 1.0;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 2;
gzip_disable msie6;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/xml+rss;

client_max_body_size 110m;
client_body_buffer_size 1024k;

keepalive_timeout   60;

sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
tcp_nodelay on;

ssl_session_cache   shared:SSL:10m;
ssl_session_timeout 30m;
ssl_certificate /etc/nginx/ssl/new.api.zentrust.cn/fullchain.cer;
ssl_certificate_key /etc/nginx/ssl/new.api.zentrust.cn/privkey.key;

location ^~ /test {
    alias   /var/www/new.api.zentrust.cn/test/public;

    if (!-e $request_filename) {
            rewrite ^ /test/index.php last;
    }

    location ~ \.php$ {
            if (!-f $request_filename) {
                    return 404;
            }

            fastcgi_pass        unix:/tmp/php-fpm-72.sock;
            fastcgi_index       index.php;
            fastcgi_param       SCRIPT_FILENAME $request_filename;
            include             fastcgi_params;
    }
}

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

location ~ \.php$ {
    fastcgi_pass        unix:/tmp/php-fpm-72.sock;
    fastcgi_index       index.php;
    fastcgi_param       SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include             fastcgi_params;
}

location = /robots.txt  { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }

}

案例2
server
{
listen 80;
server_name test.myfxdd.com;
index index.html index.htm index.php default.html;
root /var/www/DD/test/myfxdd/view;

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
    }
location / {
try_files $uri $uri/ /index.html;
}   
    location ~ .*\.(js|css)?$
    {
        expires      12h;
    }
    location @router {
        rewrite ^.*$ /index.html last;
    }

location /backend {
alias /var/www/DD/test/myfxdd/view/backend/public;
index index.html index.php;
try_files $uri $uri/ /index.php?$query_string;
if (!-e $request_filename) {
            rewrite ^ /backend/index.php last;
    }

location ~ \.php$ {
           if (!-f $request_filename) {
                    return 404;
            }

            fastcgi_pass         127.0.0.1:9000;
            fastcgi_index       index.php;
    fastcgi_param       SCRIPT_FILENAME $request_filename;
            include             fastcgi_params;
    }

location ~ \.php {
    add_header Access-Control-Allow-Origin *;
    add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
    add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,lang,access-token';
    if ($request_method = 'OPTIONS') {
        return 204;
    }

    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_split_path_info       ^(.+\.php)(/.+)$;
    fastcgi_param PATH_INFO       $fastcgi_path_info;
    fastcgi_param PATH_TRANSLATED /var/www/DD/test/myfxdd/view/backend/public/$fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME /var/www/DD/test/myfxdd/view/backend/public/$fastcgi_script_name;
    include                       fastcgi_params;
}

    error_log  /usr/local/nginx/logs/error.dev.myfxdd.com.log;
access_log /usr/local/nginx/logs/access.dev.myfxdd.com.log;

}
}

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

新聞名稱:Nginx配置二級(jí)虛擬目錄訪問(wèn)Laravel后臺(tái)重寫-創(chuàng)新互聯(lián)
網(wǎng)站網(wǎng)址:http://www.muchs.cn/article34/dieppe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)公司、網(wǎng)站制作定制網(wǎng)站、App設(shè)計(jì)、電子商務(wù)、軟件開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

綿陽(yáng)服務(wù)器托管