Rumah > Soal Jawab > teks badan
lokasi ~ .*.jsp$ { # Memadankan fail yang berakhir dengan fail halaman web Tomcat berakhir dengan jsp.
indeks indeks.jsp;
proxy_pass http://127.0.0.1:8080 #Sediakan proksi di sini
}
Adakah 127.0.0.1:8080 di sini sama seperti ini atau nama domain sebenar Sebagai contoh, http://www.xxx.com:8080?
巴扎黑2017-05-16 13:04:36
Alamat akses: http://www.xxx.com Konfigurasi adalah seperti berikut:
server {
listen 80;
server_name www.xxx.com;
access_log logs/xxx.access.log main;
location / {
root html;
index index.html index.htm;
}
location ~ .*.jsp$ { #匹配以jsp结尾的,tomcat的网页文件是以jsp结尾
index index.jsp;
proxy_pass http://127.0.0.1:8080; #主要在这里,设置一个代理
}
}
}