Php OROCRM Nginx虚拟主机配置不工作

Php OROCRM Nginx虚拟主机配置不工作,php,apache,symfony,nginx,orocrm,Php,Apache,Symfony,Nginx,Orocrm,我已使用Nginx和PHP7在AWS Lightsail VPS上安装了orocrm。orocrm安装顺利,但我第一次使用Nginx,我的虚拟主机似乎无法正常工作 可用站点/默认站点: 服务器{ 监听80个默认_服务器; 侦听[:]:80默认_服务器 root /var/www/html; index app.php index.php index.html; server_name 34.127.224.10; location

我已使用Nginx和PHP7在AWS Lightsail VPS上安装了orocrm。orocrm安装顺利,但我第一次使用Nginx,我的虚拟主机似乎无法正常工作

可用站点/默认站点: 服务器{ 监听80个默认_服务器; 侦听[:]:80默认_服务器

        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;
        }
}
然后我购买并将crmdomain.com指向我的实例,并创建了另一个文件

可用站点/客户关系管理:

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;
        }
}
老实说,我不知道上面的大部分内容,它主要基于教程和apache经验

错误

基于域的

 - 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**
基于静态IP的

 - 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**

我做错了什么?

奇怪的是,我经常回答自己的问题:

我可以更改默认文件并删除额外的虚拟主机。因为服务器只将承载一个应用程序

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