Welcome! Log In Create A New Profile

Advanced

Nginx 'alias' downloading php file

Posted by moremadness 
Nginx 'alias' downloading php file
August 01, 2016 10:29AM
I am struggling to get the Nginx alias working on my website. The php files is being downloaded instead of rendered.

The URL in question is: /ticketsales/new-tickets

upstream php-handler-http {
server 127.0.0.1:9000;
#server unix:/var/run/php5-fpm.sock;
}

server {
listen 80 default_server;
server_name _;
#server_name wordpress.example.com;

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

# set max upload size
client_max_body_size 2G;
fastcgi_buffers 64 4K;

access_log /var/log/nginx/wordpress_http_access.log combined;
error_log /var/log/nginx/wordpress_http_error.log;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

location ^~ /ticketsales/new-tickets {
alias /var/www/html/ticketsales/wp-content/themes/tout/new-tickets;
}

location /events {
rewrite ^(.*)$ http://www.example.com/future-events.php redirect;
}

location / {
try_files $uri $uri/ /index.php?$args ;
}

location ~* \.(htaccess|htpasswd) {
deny all;
}

location ~ \.php(?:$|/) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass php-handler-http;
fastcgi_read_timeout 60s;
}

location ~* \.(?:jpg|jpeg|gif|bmp|ico|png|css|js|swf)$ {
expires 30d;
access_log off;
}
}
Re: Nginx 'alias' downloading php file
May 05, 2017 05:12PM
I, I get the same problem.
How can I fix it?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 175
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready