Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Ejecutando Wordpress/NGINX desde una ruta diferente

Estoy aprendiendo NGINX, por lo que cualquier ayuda es realmente apreciada.

Tengo la interfaz de un sitio web ejecutándose como la raíz de mysite.com, y ahora quiero ejecutar wordpress desde mysite.com/blog.

La estructura de mi archivo es: /srv/mysite/frontend /srv/mysite/wordpress

este es el error que he estado recibiendo de los registros de nginx

2020/03/29 00:09:03 [error] 23049#23049: *39 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: XXXXXXX, server: www.mysite.com, request: "GET /api HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "mysite.com"

y este es mi archivo de configuración nginx hasta ahora

 listen 80 default_server; server_name www.mysite.com mysite.com; charset utf-8; location ^~ /blog { root /srv/mysite/wordpress; } location ~ \.php$ { fastcgi_pass unix:/run/php/php7.2-fpm.sock; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; } location / { root /srv/mysite/frontend/dist; try_files $uri /index.html; } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Este mensaje de error muestra la ruta incorrecta del archivo sock o los permisos. Asegúrese de que el archivo php sock exista en la ruta /run/php/php7.2-fpm.sock y cambie los permisos del archivo.

 For Debian chown -R wwww-data:www-data /run/php/php7.2-fpm.sock For Rhel chown -R nginx:nginx /run/php/php7.2-fpm.sock

Además, puedes probar esta configuración.

 location /blog { root /srv/mysite/wordpress; } location ~ \.php$ { try_files $uri /index.php =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!