Hi there,
I want to have a custom webserver running on the AXC F 2152 on FW 2025.0 which I have done successfully using systemd (custom .service file).
Basically, It serves my files at :8080/control/, so at path /control
Now I am trying around with nginx such that /control automatically hits my endpoint, but atm I get redirected to /wbm all the time.
Here is the attempted nginx config in /etc/nginx/sites-available/sbgui:
I’ve done nginx -t, nginx -s reload , systemctl reload nginx etc. but it seems to not change anything. If i do not type the port :8080, i get redirected to /wbm. Any ideas?
Hi,
The port 80 (as well as 443) are used and blocked by the wbm of the plcnext.
Those are defined in the file: /etc/nginx/nginx.conf
In order to use the ports 80 and / or 443 you would have to edit the above mentioned file with a location block.
This is however discouraged, because it could cause errors and break the wbm of the plcnext.
The recommended solution is to use a separate port as you are doing right now.
Hi,
Yes I wanted to use port 8080 anyways, however, I get redirected always to /wbm.
So, my backend lives at :8080/control/, how can I configure nginx such that /control does not forward to /wbm?
I assume that it cannot find /control at :80 or :443 and therefore redirects with 301/302 to /wbm, which makes sense. I just dont know how to tell the system that /control/ and /control/abc/ does not need to be sent to :80 or :443 but instead to :8080
Just for my understanding let me rephrase your problem in my own words and please tell me if I understood it correctly:
You can currently see your files if you open the URL “:8080/control” in the browser.
But you cannot see them if you open the URL “/control” in the browser.
Your expected result is that if you try to open “/control” in the browser it the files hosted at “:8080/control” will be shown.
If you enter a “http” URL in the browser it is always defaulted at port 80, the browser simply hides the port in the address field. And if a “https” URL is entered, it defaults at port 443.
Therefore if you want to enter a URL “/control” you will have to use the ports 80 or 443 in your nginx.conf.
As previously stated, these ports are used blocked by the PLCnext WBM.
The file can be found in: /etc/nginx/nginx.conf
This config works for me. For people interested, I’ve created a little shell script for helping with deployment. Therefore I have enabled ssh root access with ssh keys. Works well