Trouble in configuring fir REST support

hemanthnews at yahoo.com hemanthnews at yahoo.com
Fri Nov 25 11:33:02 UTC 2016


Hi,
Following is the environment 
OS: CentOS 7 (64 bit) 
NGINX: 1.10.1
PHP/PHP-FPM:  5.6 
ZF2 
Apache 2.4

Nginx configured on port-80 and apache on port-9080

I am having trouble in configuring for REST support using nginx + php + zf2 
When I enter <ip-address:9080>/user-rest while using APACHE (Port: 9080), I get all the user data 
When I try with <ip-address>/user-rest  (nginx on port:80), I get a blank screen  with Firefox and Chrome reports “HTTP ERROR 500” 


Following is my configuration file under /etc/nginx/conf.d/pixflex_nginx.conf
Would appreciate feedback / fix to support REST 

server {
      2         listen       80 default;
      3         listen       443 ssl;
      4         server_name  $hostname;
      5         client_max_body_size 8192M;
      6         client_header_timeout 300s;
      7         client_body_timeout 300s;
      8         fastcgi_read_timeout 300s;
      9         fastcgi_buffers 16 128k;
     10         fastcgi_buffer_size 256k;
     11
     12         #SSL Support - key & certificate location;
     13         ssl_certificate /etc/pki/tls/certs/ca.crt;
     14         ssl_certificate_key /etc/pki/tls/private/ca.key;
     15
     16         #VirtualHost for HTML Support
     17         location / {
     18                 #root   /usr/share/nginx/html;
     19                 limit_rate 512k;
     20                 limit_conn pfs 100;
     21                 add_header 'Access-Control-Allow-Origin' "*";
     22                 add_header 'Access-Control-Allow-Credentials' 'true';
     23                 add_header 'Access-Control-Allow-Headers' 'Content-Type,accept,x-wsse,origin';
     24                 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
     25
     26                 root /opt/riversilica/pixflex/install/app_server/pixflex/public;
     27                 index  index.php index.phtml index.html index.htm;
     28                 try_files $uri $uri/ /index.php$is_args$args;
     29          }
     30 
     31         #error_page  404              /404.html;
     32         #redirect server error pages to the static page /50x.html
     33
     34         #error_page   500 502 503 504  /50x.html;
     35         #location = /50x.html {
     36         #       root   /usr/share/nginx/html;
     37         #}
     38
     39         #proxy the PHP scripts to Apache listening on 127.0.0.1:80
     40         #location ~ \.php$ {
     41         #    proxy_pass   http://127.0.0.1;
     42         #}
     43
     44         #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
     45         location ~ \.php$ {
     46                 #root   /usr/share/nginx/html;
     47                 limit_rate 512k;
     48                 limit_conn pfs 100;
     49
     50                 root /opt/riversilica/pixflex/install/app_server/pixflex/public;
     51                 try_files $uri =404;
     52                 fastcgi_pass   127.0.0.1:9000;
     53                 fastcgi_index  index.php;
     54                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     55                 fastcgi_split_path_info ^(.+\.php)(/.+)$; 
     56                 fastcgi_intercept_errors on;
     57                 fastcgi_read_timeout 300;
     58                 include fastcgi_params;
     59         }
     60
     61         # deny access to .htaccess files, if Apache's document root
     62         # concurs with nginx's one
     63         location ~ /\.ht {
     64                 deny  all;
     65         }
     66 }





--------------------
-Best
Hemanth

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20161125/36369077/attachment.html>


More information about the nginx mailing list