我已經在 Ubuntu 機器上成功設定了 QGIS 服務器。
我想訪問一些網址上的地圖說:121.123.124.124/qgisserver
我目前正在通過以下方式訪問我的 laravel 應用程式121.123.124.124/
我已經為 qgisserver 配置了虛擬主機,如下所示:
server {
listen 80;
server_name 121.123.124.124;
location = /qgisserver {
gzip off;
include fastcgi_params;
fastcgi_pass unix:/var/run/qgisserver.socket;
}
}
遵循此處的培訓手冊https://docs.qgis.org/3.22/en/docs/server_manual/getting_started.html#installation-on-debian-based-systems
laravel 應用程式主機檔案如下所示:
server { listen 80; server_name 121.123.124.124; root /var/www/html/laravel-app/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(. \.php)(/. )$; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ /\.(?!well-known).* { deny all; } }
我通過在啟用站點的檔案夾中符號鏈接并重新啟動 nginx 服務來啟用 qgisserver 虛擬主機。
但是,當我訪問時121.123.124.124/qgisserver,它會回傳默認的 laravel 404 錯誤頁面。
我怎樣才能通過該位置成功訪問我的 qgis 地圖121.123.124.124/qgisserver并仍然訪問應用程式121.123.124.124/
謝謝你。
uj5u.com熱心網友回復:
您不應該為此使用單獨的服務器塊,尤其是使用相同的服務器名稱!您應該已經收到一條 nginx 訊息,例如nginx: [warn] conflicting server name "121.123.124.124" on 0.0.0.0:80, ignored;它不是警告你你做錯了什么嗎?將該位置放入提供 laravel 應用程式的同一服務器塊中。要防止 QGIS 服務器 URL 以任何方式干擾您的 laravel 應用程式,請使用^~location 修飾符:
location ^~ /qgisserver {
gzip off;
include fastcgi_params;
fastcgi_pass unix:/var/run/qgisserver.socket;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/492385.html
標籤:拉拉维尔 nginx nginx-反向代理 qgis 虚拟主机
上一篇:根據Ruby中的哈希鍵計算陣列
