Jump to content

Nginx Reverse Proxy


mterceno

Recommended Posts

Hi all,

Did you have  already to setup un reverse proxy with an UniGUI application ?
I try this setup but I receive always this message from uniGui App : Loading...

The current configuration is :

 server {
        listen 80;
        server_name 127.0.0.1;
    
		location /portal/ {     
            proxy_set_header X-Real-IP $remote_addr;	
			#proxy_set_header Host 127.0.0.1;
			proxy_pass http://192.168.150.70:8077/;			
			#proxy_ssl_server_name on;
        }

This returned message tell me that it's Unigui App returns this. So, the redirection seems work fine. But, why i have this message from unigui app ?

 

Thank you,

 

Link to comment
Share on other sites

  • 4 months later...

HI, same problem .. only Loading ... displayed

I update UrlReferer but only Restart Application URL is corrent.

All links to ext , uni ... are wrong.

Or is there any other solution ?

link rel=stylesheet href="/uni-1.70.0.1486/css/uni-ext.css" />
<link rel=stylesheet href="/ext-6.6.0/build/classic/theme-classic/resources/theme-classic-all.css" />
<script src="/ext-6.6.0/build/ext-all.js"></script>
<script src="/ext-6.6.0/build/classic/theme-classic/theme-classic.js"></script>
<script src="/uni-1.70.0.1486/ext-unicommon-min.js"></script>
<script src="/uni-1.70.0.1486/ext-sync-min.js"></script>
<script src="/ext-6.6.0/build/classic/locale/locale-cs.js"></script>
<script src="/uni-1.70.0.1486/jQuery/jquery-1.11.2.min.js"></script>
<link rel=stylesheet href="/ext-6.6.0/build/packages/font-awesome/resources/font-awesome-all.css" />
<link rel=stylesheet href="/ext-6.6.0/build/packages/font-pictos/resources/font-pictos-all.css" />
<script src="/uni-1.70.0.1486/jQuery/MaskedInput/jquery.inputmask.min.js"></script>
<script src="/uni-1.70.0.1486/jQuery/autoNumeric/autoNumeric-1.9.35.js"></script>
<link rel=stylesheet href="/uni-1.70.0.1486/css/uni-xtheme-common.css" />
<link rel=stylesheet href="/uni-1.70.0.1486/css/uni-xtheme-classic.css" />
<script src="/uni-1.70.0.1486/ext-unigui-min.js"></script>

Thank you.

Link to comment
Share on other sites

On 11/9/2019 at 7:27 PM, svap said:

HI, same problem .. only Loading ... displayed

I update UrlReferer but only Restart Application URL is corrent.

All links to ext , uni ... are wrong.

Or is there any other solution ?


link rel=stylesheet href="/uni-1.70.0.1486/css/uni-ext.css" />
<link rel=stylesheet href="/ext-6.6.0/build/classic/theme-classic/resources/theme-classic-all.css" />
<script src="/ext-6.6.0/build/ext-all.js"></script>
<script src="/ext-6.6.0/build/classic/theme-classic/theme-classic.js"></script>
<script src="/uni-1.70.0.1486/ext-unicommon-min.js"></script>
<script src="/uni-1.70.0.1486/ext-sync-min.js"></script>
<script src="/ext-6.6.0/build/classic/locale/locale-cs.js"></script>
<script src="/uni-1.70.0.1486/jQuery/jquery-1.11.2.min.js"></script>
<link rel=stylesheet href="/ext-6.6.0/build/packages/font-awesome/resources/font-awesome-all.css" />
<link rel=stylesheet href="/ext-6.6.0/build/packages/font-pictos/resources/font-pictos-all.css" />
<script src="/uni-1.70.0.1486/jQuery/MaskedInput/jquery.inputmask.min.js"></script>
<script src="/uni-1.70.0.1486/jQuery/autoNumeric/autoNumeric-1.9.35.js"></script>
<link rel=stylesheet href="/uni-1.70.0.1486/css/uni-xtheme-common.css" />
<link rel=stylesheet href="/uni-1.70.0.1486/css/uni-xtheme-classic.css" />
<script src="/uni-1.70.0.1486/ext-unigui-min.js"></script>

Thank you.

Are you under IIS?

I was having the same problem and found that the error was in my nginx conf.

worker_processes  1;
error_log  logs/error.log  warn;

events {
	worker_connections  1024;
}

http {

	proxy_connect_timeout 1800;
	proxy_send_timeout 1800;
	proxy_read_timeout 1800;
	send_timeout 1800;

	client_max_body_size 0;	
	
	server {
		listen 80;
		
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header Host $host:$server_port;
		proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Host   $host;		
		
        location /test {			
			proxy_pass http://localhost:91;
		}
	}	
}

 

Link to comment
Share on other sites

Here is my full configuration to work with Unigui and nginx under IIS.

It's not completely how I would like to be but it's working.

My unigui version is 1.0.0.1416

IIS 10

Windows Server 2019

Deploying with ISAPI mode (DLL File)

Customized the uni and ext files so I copy them to my application folder.

C:\webapp (folder)

C:\webapp\web.config (created by IIS)

C:\webapp\app (folder)

C:\webapp\app\UniguiApplication.dll

C:\webapp\app\files\ext (folder copied and customized from default installation)

C:\webapp\app\files\uni (folder copied and customized from default installation)

In ServerModule you must change

ExtRoot = .\files\ext\

UniRoot = .\files\uni\

nginx.conf

worker_processes  1;
error_log  logs/error.log  warn;

events {
	worker_connections  1024;
}

http {

	proxy_connect_timeout 1800;
	proxy_send_timeout 1800;
	proxy_read_timeout 1800;
	send_timeout 1800;

	client_max_body_size 0;	
	
	server {
		listen 80;
		
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header Host $host:$server_port;
		proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
		proxy_set_header X-Forwarded-Host   $host;		
		
        location /app {			
			proxy_pass http://localhost:91;
		}
	}	
}

In your IIS, you must add in Default Document the file to be loaded UniguiApplication.dll

That's it.

To test, just put your local ip /app to test.

PS: What I'm trying yet to do is change proxy_pass to "http://localhost:91/;" With this slash in the end so the unigui application will look into "C:\webapp" and not in "C:\webapp\app" folder.

But if you do this, the files of unigui will not be loaded.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...