我已將我的域 rohanpatra.ga 指向我的服務器并安裝了 nginx。我目前在服務器上運行兩個域,rohanpatra.ga 和 meetsecured.tk。MeetSecured 是一個基于 Jitsi Meet 的區塊鏈視頻會議平臺,目前運行良好。但是,當我訪問 rohanpatra.ga 時,它只會轉到默認的 nginx 頁面。我已經創建了配置文件:站點可用目錄 配置文件內容server { listen 80; listen [::]:80; root /var/www/rohanpatra.ga; index index.php index.html index.htm; server_name your_domain; location / { try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; }}并將文件符號鏈接到 sites-enabled 文件夾:啟用站點的目錄這是站點的根目錄和一個文件 index.php 的內容:/var/www/rohanpatra.ga 目錄索引.php<?php
phpinfo();?>按照要求:root@debian-8gb-hel1-1:~# ps auxww |grep nginx回答root 5874 0.0 0.1 70944 9032 ? Ss May30 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;www-data 9129 0.0 0.1 71228 9516 ? S 21:52 0:00 nginx: worker processwww-data 9130 0.0 0.0 71228 6344 ? S 21:52 0:00 nginx: worker processwww-data 9131 0.0 0.0 71228 6344 ? S 21:52 0:00 nginx: worker processwww-data 9132 0.0 0.0 71228 6344 ? S 21:52 0:00 nginx: worker processroot 10356 0.0 0.0 6144 888 pts/0 S+ 22:29 0:00 grep nginx
1 回答

GCT1015
TA貢獻1827條經驗 獲得超4個贊
根據Nginx 文檔,您在配置中錯誤配置了 server_name 參數。
正確的配置應該是這樣的:
server {
? ? listen 80;
? ? server_name rohanpatra.ga;
? ? root /var/www/rohanpatra.ga;
? ? index index.php index.html index.htm;
? ? location / {
? ? ? ? try_files $uri $uri/ =404;
? ? }
? ? location ~ \.php$ {
? ? ? ? include snippets/fastcgi-php.conf;
? ? ? ? fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
? ? }
}
并確保此 FQDNrohanpatra.ga在服務器本身上正確解析。
您可以通過在服務器控制臺鍵入:進行檢查nslookup rohanpatra.ga。
- 1 回答
- 0 關注
- 167 瀏覽
添加回答
舉報
0/150
提交
取消