我需要为Apache下的一些Wordpress网站设置一个nginx代理,而我的nginx conf只适用于我的15个网站中的12个。
这是我为每个网站提供的配置文件:
server {
listen 80;
server_name domain.com www.exemple.com;
return 301 https://www.exemple.com;
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name exemple.com www.exemple.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/exemple.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/exemple.com/privkey.pem;
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate
/etc/letsencrypt/live/exemple.com/fullchain.pem;
ssl_session_cache shared:SSL:100m;
ssl_session_timeout 24h;
ssl_session_tickets on;
ssl_session_ticket_key /etc/nginx/ssl/ticket.key;
ssl_dhparam /etc/nginx/ssl/dhparam4.pem;
ssl_ecdh_curve secp384r1;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers [SOME CIPHERS]
location / {
proxy_set_header X-Original-Request $request_uri;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://127.0.0.1:7080;
}
}
和apache vhost:
<VirtualHost *:7080>
ServerName exemple.com
ServerAlias www.exemple.com
DocumentRoot /var/www/wp_domain
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
我的apache在端口7080上运行。 我已经在我的apache webroot上测试了一个index.php和没有htaccess但是没有工作......
我不知道为什么我的三个网站都无法正常工作。
感谢您的帮助