我根据下面@Gerard H. Pille 的建议更新了这个问题。
第一次设置。我已经在某项目的主机上Virtualbox
运行了。Ubuntu 18.04
Win 10
wordpress
我的共享文件夹已安装/media/sw_wp
并正常运行
我的项目文件夹仅包含一个项目,位于/media/wp_sf/myproj
我正在使用这个nginx
从这里配置:
# Upstream to abstract backend connection(s) for php
upstream php {
server unix:/tmp/php-cgi.socket;
server 127.0.0.1:9000;
}
server {
## Your website name goes here.
server_name myproj.com.au;
## Your only path reference.
root /var/www/html/myproj;
## This should be in your http block and if it is, it's not needed here.
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi.conf;
fastcgi_intercept_errors on;
fastcgi_pass php;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
sites-available
我已经创建了从到的符号链接sites-enabled
,并且可以使用来查看该链接ls
。
/var/www/html/myproj
包含我的 wordpress 安装。
我已经从共享文件夹创建了一个符号链接,因此它现在显示为:
/var/www/html/myproj
客人的其他一切都是ubuntu + php 7.2 + nginx + mysql
当我浏览项目时我得到:
This site can’t be reached
myproj.com.au refused to connect.
下面的结果nslookup myproj.com.au
是
Server 127.0.0.53
Server Address 127.0.0.53#53
Non-authoritative answer:
Name: myproj.com.au
Address: 52.64.... // An IP I do not recognise
我可以从主机中 ping 客户机DOS window
,并且得到响应。因此环境设置正确。
ping myproj.com.au
我错过了什么?谢谢。