2017-02-23 3 views
0

Ich habe eine Orocrm auf einem AWS Lightsail VPS mit Nginx & PHP7 installiert. orocrm ohne Probleme installiert, aber ich benutze Nginx zum ersten Mal und mein virtueller Host scheint nicht zu funktionieren.OROCRM Nginx Virtual Host-Konfiguration funktioniert nicht

sites-available/default: Server { listen 80 default_server; listen [::]: 80 default_server;

 root /var/www/html; 
     index app.php index.php index.html; 
     server_name 34.127.224.10; 

     location/{ 
       try_files $uri $uri/ =404; 
     } 

     location ~ \.php$ { 
       fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
       fastcgi_index index.php; 
       fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 
       include  fastcgi_params; 
     } 

     location ~ /\.ht { 
       deny all; 
     } 
} 

Ich kaufte dann & spitze crmdomain.com meine Instanz und eine weitere Datei erstellt.

sites-available/crm:

server { 
     listen 80; 
     server_name crmdomain.com www.crmdomain.com; 
     root /var/www/html/crm/web; 

     index app.php; 

     error_log /var/log/nginx/orocrm_error.log; 
     access_log /var/log/nginx/orocrm_access.log; 

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

     location @rewrite { rewrite ^/(.*)$ /app.php/$1; } 

     location/{ 
       try_files $uri /app.php$is_args$args; 
     } 

     location ~ [^/]\.php(/|$) { 
       fastcgi_split_path_info ^(.+?\.php)(/.*)$; 
       if (!-f $document_root$fastcgi_script_name) { 
         return 404; 
       } 
       fastcgi_index app.php; 
       fastcgi_read_timeout 10m; 
       fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
       include fastcgi_params; 
     } 
} 

Ich weiß nicht ehrlich die meisten von dem, was oben ist, ist es meist auf Tutorial und Apache-Erfahrung.

Fehler

Domain basierend

- crmdomain.com -> 403 Forbidden nginx/1.10.0 (Ubuntu) 
- crmdomain.com/app.php -> No input file specified. 
- crmdomain.com/app_dev.php -> No input file specified. 
- crmdomain.com/index.nginx-debian.html -> Welcome to nginx! 
- crmdomain.com/user/login -> 404 Not Found nginx/1.10.0 (Ubuntu) **This is what should word** 

Statische IP

Basis
- 34.127.224.10 -> 403 Forbidden nginx/1.10.0 (Ubuntu) 
- 34.127.224.10/crm/web/ - No input file specified. 
- 34.127.224.10/crm/web/app.php - No input file specified. 
- 34.127.224.10/crm/web/app_dev.php - No input file specified. 
- 34.127.224.10/index.nginx-debian.html -> Welcome to nginx! 
- 34.127.224.10/crm/web/app.php/user/login -> 404 Not Found nginx/1.10.0 (Ubuntu) **This is what should word** 

Was mache ich falsch?

Antwort

0

Es ist seltsam, wie oft ich meine eigenen Fragen beantworten:

ich in der Lage war, die Standarddateien zu ändern und die zusätzliche virtuelle Host entfernen. Da der Server nur die eine App hosten würde.

server { 
     listen 80 default_server; 
     listen [::]:80 default_server; 

     server_name 34.127.224.10 crmdomain.com www.crmdomain.com; 
     root /var/www/html/crm/web; 
     index app.php app_dev.php index.php; 

     location/{ 
       # try to serve file directly, fallback to app.php 
       try_files $uri /app.php$is_args$args; 
     } 

    location ~ ^/(app|app_dev|config|install)\.php(/|$) { 
      #fastcgi_pass 127.0.0.1:9000; 
      # or 
      fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
      fastcgi_split_path_info ^(.+\.php)(/.*)$; 
      include fastcgi_params; 
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
      fastcgi_param HTTPS off; 
    } 

     error_log /var/log/nginx/orocrm_error.log; 
     access_log /var/log/nginx/orocrm_access.log; 
}