Radzhab
@Radzhab

Настройка nginx для wordpress?

Основной фронт крутится на vue. Nginx редиректит всё на прокси фронта. Хочу добавить отдельно сайт на вордпрессе в подпапке xxx.ru/wordpress (никак не связан с основным сайтом).
Когда я перехожу на xxx.ru/wp-admin/index.php - все работаёт. Но когда перехожу на xxx.ru/wordpress/index.php - он редиректит на xxx.ru. Не могу понять почему

server {
    server_name xxx.ru http2;
	resolver 8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout 5s;


    add_header Strict-Transport-Security "max-age=31536000" always;
    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Robots-Tag none;
	gzip on;
    gzip_proxied any;
    gzip_types
		text/css
		text/javascript
		application/javascript
		application/json
		text/xml
        text/json;

    location / {
		proxy_pass http://localhost:3000/;
    }

    location /assets/ {
		proxy_pass http://localhost:3000/assets/;
    }

    location /api/ {
		proxy_pass http://localhost:8080/api/;
    }

    location /graphql/ {
		proxy_pass http://localhost:4000;
    }

	location /static {
		proxy_pass http://localhost:4000/static;
    }

	location /img/ {
		proxy_pass http://localhost:8080/img/;
	}

	root /var/www/;
	index index.php index.html index.htm;


	location /wordpress/ {

	    alias /var/www/wordpress/;
	    index index.php index.html index.htm;
	    try_files $uri $uri/ /index.php;
	}
	

	location ~ \.php$ {
	    try_files $uri =404;
	    fastcgi_split_path_info ^(.+\.php)(/.+)$;
	    include fastcgi.conf;       
	    fastcgi_index index.php;
	    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	    #include fastcgi_params;
	    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
	
	}
  • Вопрос задан
  • 108 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы