1 回答

TA貢獻1906條經驗 獲得超3個贊
在四處尋找后,我找到了解決方案。這……很簡單……所以我將分享配置的每個部分,以便人們在未來不會浪費時間……
這是總體情況
請記住,對于第一次嘗試,我不會將 SSL 與 Let's encrypt 一起使用,我將保留它以備后用。目前,這是簡單的 http。
在 NGINX 代理上,我使用此配置文件 ( /etc/nginx/sites-available/www.mouradcloud.com ) 創建了一個站點
server {
listen 80;
server_name www.mouradcloud.com;
location / {
proxy_pass http://www.corph.mouradcloud.com;
sub_filter_once off;
sub_filter 'www.corph.mouradcloud.com' 'www.mouradcloud.com';
sub_filter_types *;
}
}
在 VM Wordpress&Nginx 上,這里是 wp-config.php (/var/www/mouradcloud/wp-config.php),我確實添加了 2 行:
define('WP_SITEURL', 'http://www.corph.mouradcloud.com');
define('WP_HOME', 'http://www.corph.mouradcloud.com');
最后在我的 WM WOrdpress&Nginx 中,我沒有更改我的 nginx Web 服務器的配置,這仍然是相同的(/etc/nginx/sites-available/www.corph.mouradcloud.com):
upstream php-wp {
server unix:/var/run/mouradcloud.sock;
}
server {
listen 80;
listen [::]:80;
server_name www.corph.mouradcloud.com;
root /var/www/mouradcloud;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ .php$ {
include fastcgi.conf;
fastcgi_pass php-wp;
}
location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
不是 Http 工作我會看看 https ...
- 1 回答
- 0 關注
- 128 瀏覽
添加回答
舉報