Zend Framework on nginx

前端 未结 8 1266
小蘑菇
小蘑菇 2021-01-30 09:51

The Zend Framework based site I have been working on is now being migrated to its production server. This server turns out to be nginx (surprise!). Naturally the site does not w

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-30 10:15

    server {
    
     listen   80; ## listen for ipv4
     listen   [::]:80 default ipv6only=on; ## listen for ipv6
    
     server_name  localhost;
    
     access_log  /var/log/nginx/localhost.access.log;
     error_log  /var/log/nginx/localhost.error.log;
    
     root   /var/www/localhost/public;
    
     try_files $uri @php_index;
    
     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
     #
     location @php_index {
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_param  SCRIPT_FILENAME /var/www/localhost/index.php;
      include fastcgi_params;
     }
    }
    

    It's recommended to use try_files when ever possible.

提交回复
热议问题