我会尝试尽可能详细地说明这一点,因为我觉得我已经尝试了所有的东西,而且此时只需要另外一套眼睛。
我正在运行云服务器,我已经通过终端安装了我的LEMP堆栈。此外,这是一个magento构建。我已将所有文件迁移到正确的文件夹中。 var / www / html我安装了mysql并导入了我的数据库。
我目前能够运行mywebsite.com/info.php
tki@me:/$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
tki@me:/$ ls -al /etc/nginx/sites-enabled/
total 8
drwxr-xr-x 2 root root 4096 Feb 6 18:44 .
drwxr-xr-x 6 root root 4096 Feb 6 18:03 ..
lrwxrwxrwx 1 root root 34 Feb 4 15:48 default -> /etc/nginx/sites-available/default
tki@me:/$ sudo lsof -i -P | grep -i "listen"
sendmail- 1084 root 3u IPv4 14208 0t0 TCP localhost:25 (LISTEN)
sendmail- 1084 root 5u IPv4 14209 0t0 TCP localhost:587 (LISTEN)
sshd 1122 root 3u IPv4 14322 0t0 TCP *:22 (LISTEN)
sshd 1122 root 4u IPv6 14331 0t0 TCP *:22 (LISTEN)
mysqld 14732 mysql 19u IPv4 76527 0t0 TCP localhost:3306 (LISTEN)
这是我的网站 - 可用/默认
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
# Add index.php to the list if you are using PHP
#index index.html index.htm index.nginx-debian.html;
#server_name server_domain_or_IP;
server_name mysite.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
这是我的网站启用/默认
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;
# Add index.php to the list if you are using PHP
#index index.html index.htm index.nginx-debian.html;
#server_name server_domain_or_IP;
server_name mysite.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Here is my nginx.conf file:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# fastcgi_param MAGE_RUN_CODE default;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
我的配置有什么明显的错误吗?