nginx只加载index.php

时间:2016-02-23 10:05:12

标签: php nginx lxc nginx-location

我的nginx配置有问题。我们公司有一个Vagrant盒子。在这个流浪汉,我们有服务的LXC容器,如nginx容器,php-fpm容器,memcached容器,mysql容器......这些是相互连接的,nginx使用php-fpm,php-fpm使用memcached和mysql。我可以通过https访问流浪者之外的nginx。这是我的nginx配置:

nginx.conf:

user              nginx  nginx;

worker_processes  4;

pid        /var/run/nginx.pid;

worker_rlimit_nofile 1024;

events {
        worker_connections 2048;
        use epoll;
        multi_accept on;
}


http {

       include /etc/nginx/mime.types;
        default_type application/octet-stream;
        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        access_log "/var/log/nginx/access.log";
        error_log "/var/log/nginx/error.log";
        keepalive_timeout 120;

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}
deault.conf:

server {
   listen *:80;
   server_name vagrant.ceg.com;
   return 301 'https://$server_name$request_uri';
}

https.conf:

server {
   listen *:443;
   ssl on;
   ssl_certificate ....crt;
   ssl_certificate_key ....key;
   server_name vagrant.ceg.com www.vagrant.ceg.com;
   root "/srv/www";
   index index.php;
   location / {
       autoindex on;

   }
   location ~ \.php$ {
       include /etc/nginx/fastcgi_params;
       fastcgi_param ENVIRONMENT dev;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_index index.php;
       if (-f $request_filename) {
       fastcgi_pass 192.168.42.114:9000;
   }

   }
}

当我在浏览器中打开它时,我得到了index.php,但速度很慢,我在控制台上遇到了同样的错误:

https://www.vagrant.ceg.com/cdn/util/scale/320/320/dev-employer-images/0636443e3076af9d24ba2b1711f57fb47b60f289.jpg Failed to load resource: net::ERR_CONNECTION_TIMED_OUT

0 个答案:

没有答案