Bigstack
Member
Ok So i have spent the better part of a day and a half trying to figure out how to setup the nginx config for this. I am coming from a server that had Cpanel + nginx and everything worked just fine. My new server I just put virtual min on and I belive the php is in fastcgi mode not DSO like before... The only way to get my site to work right now is to turn off friendly URLs but I have hard links to the others ones over the net.
Here is mynginx.conf (added note it also pulles in /etc/nginx/conf.d/default.conf) I can post that if necessary.
My site root is:
/home/websitehere/public_html
Any help greatly appreciated im stuck.
Here is mynginx.conf (added note it also pulles in /etc/nginx/conf.d/default.conf) I can post that if necessary.
My site root is:
/home/websitehere/public_html
Code:
user nginx;
worker_processes 2;
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 websitehere.com www.websitehere.com;
listen 45.135.177.111;
root /home/websitehere/public_html;
index index.html index.htm index.php;
access_log /var/log/virtualmin/websitehere.com_access_log;
error_log /var/log/virtualmin/websitehere.com_error_log;
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/websitehere/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/websitehere/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 unix:/var/php-nginx/136598955615441.sock/socket;
}
}
}
Any help greatly appreciated im stuck.