Your configuration and what you're doing makes absolutely no sense to me. You're setting up an nginx proxy to itself.
Moving folders also makes sense to me if you're still using a proxy.
You should probably start by explaining what you want to achieve and why.
What I see is that the traccar portal is opening from /opt/traccar/web, as well as the database, that is, I see that traccar does everything from its own directory, so I separated the traccar database and migrated it to mariadb, now what I intend to do is that the traccar web content does not open from /opt/traccar/web, but rather from the nginx root document /var/www/html/web.
Why?
Isn't that supposed to be the way it should be? Web services working in /var/www/html? Permissions being set properly under that directory structure? What's wrong with configuring the traccar web folder in the nginx documentroot?
I mean, I don't want traccar to work with the internal database it manages, so I migrated the database to a dedicated engine, maria db, it's already working.
Now I'm new to traccar, if one day the traccar platform works with real computers, won't there be any consequences if its folder works in /opt/traccar/web? Or would it be better to configure the nginx documentroot in /opt/traccar in nginx.conf.
You don't need to repeat about the database. That makes sense. You definitely want to use a proper database. But that's completely unrelated to the topic.
What you're doing with the web app doesn't make sense. What's the problem with having the app in Traccar? Why do you need to have nginx serving the folder? I guess you could do it, but there's just no good reason for it. And based on your broken configuration, it's probably better if you don't do it.
Well, as I said, I'm new to traccar, my goal is to understand and learn well about this excellent software, what happens is that traccar uses an internal web server I think it's called jetty, if one day I wanted to put the platform into production, I don't think it would be advisable to use this server, the best thing would be to leave this responsibility to nginx, what can I do to not depend on the traccar web server and better leave it with the nginx web server?
I don't think it would be advisable to use this server
That's a false assumption. You keep saying "I think" without providing any solid reasons. You should use a proper HTTP server, like nginx, but only as a proxy, not to host files.
Well, based on all this, I think what I need to do is configure nginx as a reverse proxy, I'm going to look at this type of configurations to see how it goes.
I'm going to do it Anton, I'll configure nginx as a proxy, this will finish clarifying my doubts with the traccar structure, thank you very much for your help.
Well, actually what I wanted to do was to make the traccar web folder not load in
/opt/traccar
but in/var/www/html
, so I followed the following steps./opt/traccar/conf/traccar.xml
.<entry key='web.path'>/var/www/html/web/</entry>
/var/www/html
/etc/nginx/sites-available
and a file called traccar with the following.I restarted traccar and nginx, but when I try to load the traccar page
http://192.168.0.103:8082/web/
, I get an error in the browser, such as 502 bad gateway.What am I doing wrong, or what am I missing?