ตั้งค่า Reverse-proxy Nginx + Apache สำหรับ Static image

คำถามและปัญหา webhost ที่ใช้ AlmaLinux
ตอบกลับ
รูปประจำตัวสมาชิก
slwt2002
Administrator
โพสต์: 126
ลงทะเบียนเมื่อ: พุธ 24 มิ.ย. 2015 18:03

ตั้งค่า Reverse-proxy Nginx + Apache สำหรับ Static image

โพสต์ โดย slwt2002 »

1. Do I have to setup anything at all to let Nginx processes them directly instead of proxy the request to apache?

2. I thought I would have to added something to the domains config, I thought about a CUSTOM3 token in the nginx file. I tried this:
Code:

โค้ด: เลือกทั้งหมด

location ~* \.(ico|gif|jpeg|png|jpg|mp4)$ {
	try_files $uri $uri/ /$uri;
	add_header X-Test-Nginx-Bypass "OK";
	expires 15m;
}

Now I do get the header returned that says OK. But is it really OK or did I just manage to output an extra header? I tried to search for log entries but I'm not sure where I can check to make sure it works.

3. Is my code correct, and will this also proxy the request correctly to apache if the file was not found?

ที่มา : https://forum.directadmin.com/threads/s ... ion.54002/
ไม่มีลายเซ็นต์ ขอเขียนแล้วกัน
ตอบกลับ