Welcome! Log In Create A New Profile

Advanced

NginX | Zkoss | GET | POST

Posted by vm7588 
NginX | Zkoss | GET | POST
January 18, 2014 12:28PM
Hi,
Could someone let me know if any configurations are needed to be made to NginX while using with Zkoss ?
I have two servers. 192.168.1.2 that has NginX installed and 192.168.1.3 that has Tomcat installed.

My /etc/nginx/conf.d/mysite.com.conf on 192.168.1.2 contains :
================================================
1 server {
2 listen 80;
3 server_name mysite.com;
4 #charset koi8-r;
5 #access_log /var/log/nginx/log/host.access.log main;
6
7 location /
8 {
9 proxy_set_header X-Forwarded-Host $host;
10 proxy_set_header X-Forwarded-Server $host;
11 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
12 proxy_pass http://192.168.1.3:8080/Portal/;
13 proxy_redirect http://192.168.1.3:8080/Portal/ /;
14
15 if ($request_method = POST)
16 {
17 proxy_pass http://192.168.1.3:8080;
18 }
19 }
20 location /Portal/zkau/ {
21 proxy_pass http://192.168.1.3:8080/Portal/zkau/;
22 }
23 location /Portal/images/ {
24 proxy_pass http://192.168.1.35:8080/Portal/images/;
25 }
26 location /Portal/resources/ {
27 proxy_pass http://192.168.1.3:8080/Portal/resources/;
28 }
29 location /Portal/widgets/ {
30 proxy_pass http://192.168.1.3:8080/Portal//widgets/;
31 }
32 }
================================================

I have login page login.zul which wan't working until I added the location in above files from line 20 to line 31.
Zkoss uses GET method to display the contents of login.zul. Afterwards it takes the login credentials and uses POST method to redirect the user to dashboard.zul. I received error "The server is temporarily out of service. Would you like to try again? (404:not found)." prior adding the location in above given file from line 15 to line 18.

Now the issue is that, once I reach the dashboard.zul page I get 301 http error code for POST and 404 http error code for GET although the resource is available.
================================================
x.x.x.x - - [18/Jan/2014:22:48:01 +0530] "POST /Portal/zkau HTTP/1.1" 301 184 "http://mysite.com/Portal/widgets/dashBoard.zul" "Mozilla/5.0 (Windows NT 6.0; rv:26.0) Gecko/20100101 Firefox/26.0" "-"
x.x.x.x - - [18/Jan/2014:22:48:01 +0530] "GET /Portal/zkau/ HTTP/1.1" 404 400 "http://mysite.com/Portal/widgets/dashBoard.zul" "Mozilla/5.0 (Windows NT 6.0; rv:26.0) Gecko/20100101 Firefox/26.0" "-"
================================================

How do I resolve this issue ? Also it would be helpful if some could let me know how to dynamically give the location in mysite.com.conf of sub-folder under my webapp folder i.e. Portal.

Thanks and regards,
Vee
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 241
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready