Wordpress Can';除非通过专用IP,否则无法访问nginx web服务器
对不起,如果这个问题已经被问了一百万次了,但我还没有找到答案 我正在尝试在我的计算机上托管一个wordpress站点,它运行ubuntu服务器20.04,我使用Nginx作为web服务器。到目前为止,我已经成功地使用专用IP地址192.168.0.16在我的浏览器上建立了wordpress站点: 然而,当我尝试转到我在123-reg.co.uk上购买的实际域名时,没有返回任何内容。在123-reg.co.uk DNS管理页面中,我设置了两个A记录Wordpress Can';除非通过专用IP,否则无法访问nginx web服务器,wordpress,ubuntu,nginx,dns,webserver,Wordpress,Ubuntu,Nginx,Dns,Webserver,对不起,如果这个问题已经被问了一百万次了,但我还没有找到答案 我正在尝试在我的计算机上托管一个wordpress站点,它运行ubuntu服务器20.04,我使用Nginx作为web服务器。到目前为止,我已经成功地使用专用IP地址192.168.0.16在我的浏览器上建立了wordpress站点: 然而,当我尝试转到我在123-reg.co.uk上购买的实际域名时,没有返回任何内容。在123-reg.co.uk DNS管理页面中,我设置了两个A记录 DNS ENTRY TYPE PRIO
DNS ENTRY TYPE PRIORITY TTL DESTINATION/TARGET
* A <my public ip>
@ A <my public ip>
这是我的/etc/nginx/sites available/文件:
server {
listen 80;
server_name www.<my domain name> <my domain name>;
root /var/www/wordpress/public;
index index.php;
access_log /var/www/wordpress/logs/access.log;
error_log /var/www/wordpress/logs/error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
我猜我在某个地方遗漏了一步,但我对这方面没有经验。
任何帮助都将不胜感激,我完全不知道下一步该怎么办
西蒙
server {
listen 80;
server_name www.<my domain name> <my domain name>;
root /var/www/wordpress/public;
index index.php;
access_log /var/www/wordpress/logs/access.log;
error_log /var/www/wordpress/logs/error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}
}
user www-data;
worker_processes auto;
#pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
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;
# 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 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}