Welcome! Log In Create A New Profile

Advanced

I am really stuck.

Posted by Meads 
I am really stuck.
January 13, 2013 09:16AM
I have been trying to get my server configured, I have nginx up and running and virtualmin but php just will not work, every time i request a php file it wants me to download the file.

Heres my config:

user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;


events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

include /etc/nginx/conf.d/*.conf;
server_names_hash_bucket_size 128;
server {
server_name test1.com www.test1.com;
listen 192.168.1.10;
root /home/test1/public_html;
index index.html index.htm index.php;
access_log /var/log/virtualmin/test1.com_access_log;
error_log /var/log/virtualmin/test1.com_error_log;
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/public_html$2;
index index.html index.htm;
autoindex on;
}
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
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_param SCRIPT_FILENAME /home/test1/public_html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT /home/test1/public_html;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass localhost:9001;
}
listen 192.168.1.10:443 default ssl;
ssl_certificate /home/test1/ssl.cert;
ssl_certificate_key /home/test1/ssl.key;
}
} include /etc/nginx/sites-enabled/*;


Any ideas?

Thanks



Edited 3 time(s). Last edit at 01/13/2013 09:23AM by Meads.
Re: I am really stuck.
February 01, 2013 04:51PM
i'm not sure what's with that configuration file, because you didn't specified if you installed fastcgi

anyway
no matter what Distribution you use, you should follow this tutorial

it's great

http://xDNS.ro && http://xLiST.ro Powered By nginX
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
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