<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 5 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-US><div class=WordSection1><p class=MsoNormal style='background:white'><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Hi,<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Following is the environment <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>OS: CentOS 7 (64 bit) <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>NGINX: 1.10.1<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>PHP/PHP-FPM: 5.6 <o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>ZF2 <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Helvetica",sans-serif;color:black'>Apache 2.4</span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Nginx configured on port-80 and apache on port-9080</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am having trouble in configuring for REST support using nginx + php + zf2 </p><p class=MsoNormal>When I enter <ip-address:9080>/user-rest while using APACHE (Port: 9080), I get all the user data </p><p class=MsoNormal>When I try with <ip-address>/user-rest (nginx on port:80), I get a blank screen with Firefox and Chrome reports “<span style='font-size:9.0pt;font-family:"Segoe UI",sans-serif;color:dimgray;text-transform:uppercase;background:#F7F7F7'>HTTP ERROR 500” <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Segoe UI",sans-serif;color:dimgray;text-transform:uppercase;background:#F7F7F7'><o:p> </o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Following is my configuration file under /etc/nginx/conf.d/pixflex_nginx.conf</p><p class=MsoNormal>Would appreciate feedback / fix to support REST </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>server {</p><p class=MsoNormal> 2 listen 80 default;</p><p class=MsoNormal> 3 listen 443 ssl;</p><p class=MsoNormal> 4 server_name $hostname;</p><p class=MsoNormal> 5 client_max_body_size 8192M;</p><p class=MsoNormal> 6 client_header_timeout 300s;</p><p class=MsoNormal> 7 client_body_timeout 300s;</p><p class=MsoNormal> 8 fastcgi_read_timeout 300s;</p><p class=MsoNormal> 9 fastcgi_buffers 16 128k;</p><p class=MsoNormal> 10 fastcgi_buffer_size 256k;</p><p class=MsoNormal> 11</p><p class=MsoNormal> 12 #SSL Support - key & certificate location;</p><p class=MsoNormal> 13 ssl_certificate /etc/pki/tls/certs/ca.crt;</p><p class=MsoNormal> 14 ssl_certificate_key /etc/pki/tls/private/ca.key;</p><p class=MsoNormal> 15</p><p class=MsoNormal> 16 #VirtualHost for HTML Support</p><p class=MsoNormal> 17 location / {</p><p class=MsoNormal> 18 #root /usr/share/nginx/html;</p><p class=MsoNormal> 19 limit_rate 512k;</p><p class=MsoNormal> 20 limit_conn pfs 100;</p><p class=MsoNormal> 21 add_header 'Access-Control-Allow-Origin' "*";</p><p class=MsoNormal> 22 add_header 'Access-Control-Allow-Credentials' 'true';</p><p class=MsoNormal> 23 add_header 'Access-Control-Allow-Headers' 'Content-Type,accept,x-wsse,origin';</p><p class=MsoNormal> 24 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';</p><p class=MsoNormal> 25</p><p class=MsoNormal> 26 root /opt/riversilica/pixflex/install/app_server/pixflex/public;</p><p class=MsoNormal> 27 index index.php index.phtml index.html index.htm;</p><p class=MsoNormal> 28 try_files $uri $uri/ /index.php$is_args$args;</p><p class=MsoNormal> 29 }</p><p class=MsoNormal> 30 </p><p class=MsoNormal> 31 #error_page 404 /404.html;</p><p class=MsoNormal> 32 #redirect server error pages to the static page /50x.html</p><p class=MsoNormal> 33</p><p class=MsoNormal> 34 #error_page 500 502 503 504 /50x.html;</p><p class=MsoNormal> 35 #location = /50x.html {</p><p class=MsoNormal> 36 # root /usr/share/nginx/html;</p><p class=MsoNormal> 37 #}</p><p class=MsoNormal> 38</p><p class=MsoNormal> 39 #proxy the PHP scripts to Apache listening on 127.0.0.1:80</p><p class=MsoNormal> 40 #location ~ \.php$ {</p><p class=MsoNormal> 41 # proxy_pass http://127.0.0.1;</p><p class=MsoNormal> 42 #}</p><p class=MsoNormal> 43</p><p class=MsoNormal> 44 #pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</p><p class=MsoNormal> 45 location ~ \.php$ {</p><p class=MsoNormal> 46 #root /usr/share/nginx/html;</p><p class=MsoNormal> 47 limit_rate 512k;</p><p class=MsoNormal> 48 limit_conn pfs 100;</p><p class=MsoNormal> 49</p><p class=MsoNormal> 50 root /opt/riversilica/pixflex/install/app_server/pixflex/public;</p><p class=MsoNormal> 51 try_files $uri =404;</p><p class=MsoNormal> 52 fastcgi_pass 127.0.0.1:9000;</p><p class=MsoNormal> 53 fastcgi_index index.php;</p><p class=MsoNormal> 54 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;</p><p class=MsoNormal> 55 fastcgi_split_path_info ^(.+\.php)(/.+)$; </p><p class=MsoNormal> 56 fastcgi_intercept_errors on;</p><p class=MsoNormal> 57 fastcgi_read_timeout 300;</p><p class=MsoNormal> 58 include fastcgi_params;</p><p class=MsoNormal> 59 }</p><p class=MsoNormal> 60</p><p class=MsoNormal> 61 # deny access to .htaccess files, if Apache's document root</p><p class=MsoNormal> 62 # concurs with nginx's one</p><p class=MsoNormal> 63 location ~ /\.ht {</p><p class=MsoNormal> 64 deny all;</p><p class=MsoNormal> 65 }</p><p class=MsoNormal> 66 }</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>--------------------<br>-Best<br>Hemanth</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>