I'm trying to set up various facilities laravel applications on my nginx server hhvm, but after much research and many attempts could not succeed.
Could someone help me with this? Here is my current setup:
server {
listen 80;
server_name 178.13.1.230;
root /home/callcenter/public_html/gateway;
location / {
index index.html index.php;
}
location /crm {
root /home/callcenter/public_html/gateway/crm/public;
#rewrite ^/crm/(.*)$ /$1 break;
index index.php index.html;
try_files $uri $uri/ /index.php$is_args$args /index.php?$query_string;
}
location ~ /crm/.+\.php$ {
root /home/callcenter/public_html/gateway/crm/public;
#rewrite ^/crm/(.*)$ /$1 break;
include /etc/nginx/fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include /etc/nginx/hhvm;
#fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
}
}
EDIT
Excuse my lack of attention, really did not let explained the problem right.
The server is reacting as if I was trying to make a "direct download" a file when I access 178.13.1.230/crm
What I need is that I can set up multiple laravel applications on the same server, accessing them in urls like:
The fastcgi line is commented, is being replaced by the hhvm.conf include.
Thank you for your help!
Below is a copy of the files that are on include:
/etc/nginx/hhvm.conf
location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /crm/.+\.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass unix:/var/run/hhvm/hhvm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
/etc/nginx/fastcgi.conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
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_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
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;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;