Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx 'alias' downloading php file

$
0
0
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;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>