A
A
Aleks3052015-01-26 23:10:48
Nginx
Aleks305, 2015-01-26 23:10:48

How to send html in nginx via php-fpm for a specific directory?

Good afternoon friends.
There is wordpress, which works through nginx + php-fpm. An html page was written with php code interspersed. PHP code for this page does not work (how the text is read). Tell me, how can I force nginx to give this html directory through php-fpm?
Or maybe there is another way?
Thanks everyone!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor, 2015-01-27
@merryjane

Set a separate location for this directory with proxying in fpm.
Show me your nginx configs.

A
Aleks305, 2015-01-27
@Aleks305

Good afternoon.
The config is as follows:
server {
listen 80;
server_name site.com www.site.com;
root /var/www/wordpress;
index index.php;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ^~ /v12 {
index data-recovery.html;
fastcgi_pass 127.0.0.1:9000;
}
location ~* ^.+.(js|css|png|jpg|jpeg|gif|ico)$ {
access_log off;
location ~ \.(php)$ {
# fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /www.site.com;
fastcgi_param SCRIPT_FILENAME /www.site.com$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /www.site.com$fastcgi_script_name;
include fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}
location = /favicon.ico {
log_not_found off;
access_logoff;
}
location = /robots.txt {
allow all;
log_not_found off;
access_logoff;
}
## Disable viewing .htaccess & .htpassword
location ~ /\.ht {
deny all;
}
location /phpmyadmin/ {
rewrite ^(.*) https://$server_name$1 permanent;
}
}
And so in directory v12 lies html interspersed with php. Now does not fulfill in such variant yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question