如何运行codeigniter-in-subdirectory-on-nginx-404

时间:2017-07-11 08:46:27

标签: php codeigniter nginx

我们需要运行子目录安全命名文件夹CodeIgniter文件。当我们点击secure.domain.com然后它会给出404错误(CI),但我们需要调用控制器方法,所以我们需要在URL下面运行 http://secure.domain.com/secure

我们的Nginx.conf文件包含以下语法: -



server {
  server_name secure.domain.com;
  listen 80;
  listen 443 ssl;
 root /var/www/secure/;
 index index.php;
 ssl_certificate /home/ubuntu/ssl/domain/www.erp2.domain.com.crt;
  ssl_certificate_key /home/ubuntu/ssl/erp.domain.com.key;
  location @iparksmart {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $host;
    proxy_read_timeout 500;
    proxy_redirect off;
    proxy_pass http://iparksmart;
  }
location /secure/ {
    alias  /var/www/secure/;
    try_files $uri $uri/ index.php;
    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index   index.php;
        fastcgi_pass    unix:/run/php/php7.0-fpm.sock;
        include /etc/nginx/fastcgi_params;
        fastcgi_param   SCRIPT_FILENAME $request_filename;
    }  }
  location /cable {
    proxy_pass http://iparksmart;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
  }
  error_page 500 502 503 504 /500.html;
  client_max_body_size 4G;
  keepalive_timeout 10;
}




0 个答案:

没有答案