我们计划在wordpress网站上从Apache/Httpd迁移到Nginx。我认为对我来说,挑战只在于添加
.htaccess
nginx配置中的代码,但现在每当我启用nginx时,我都会从网站获得301重定向。
我现在试图保持设置简单,只是为了看到我的主页上线。请在下面找到配置文件。
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
listen [::]:80;
server_name _;
root /var/www/html/;
include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
我目前已经从AWS ALB设置了SSL重定向。
它可以访问我的健康检查文件,但不能访问wordpress主网站
问题:主WordPress网站无法访问,但使用Apache/Httpd时运行良好。错误日志中没有明显的问题。
配置中缺少什么?任何帮助都将不胜感激!