ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comHost and DomainHost & Domain (general)https redirect บางไฟล์ (nginx)
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: https redirect บางไฟล์ (nginx)  (อ่าน 1889 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
mr.zatan
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 51
ออฟไลน์ ออฟไลน์

กระทู้: 1,163



ดูรายละเอียด
« เมื่อ: 03 มีนาคม 2020, 14:27:13 »

ถ้าจะตั้งให้  https redirect  บางไฟล์  ได้มัย

ไฟล์ที่ไม่อยากให้ redirect เป็น https คือ  mp4 mp3


nginx:

โค๊ด:
server {
    listen      %ip%:%web_port%;
    server_name %domain_idn% %alias_idn%;
return 301 https://$host$request_uri;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;



location / {

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

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

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

« แก้ไขครั้งสุดท้าย: 03 มีนาคม 2020, 14:28:25 โดย mr.zatan » บันทึกการเข้า
หน้า: [1]   ขึ้นบน
พิมพ์