Traccar Revers Proxy VirtualHost Config. i am new, need help

Ghonz

New Member
#1
Hello
my server Centos 8 stream run php server & Traccar server using NGINX, My NGINX conf support different domain names at the same ip and running smooth, i read that openlitespeed reviews and found its more faster so i decided to switch to openlitespeed
i created php virtual host for domain1.com (example) its working perfect
the problem is i cannot create traccar virtual host i tried all method to make reverse proxy but i got 500 internal server error
traccar running at port 8082 default port and here is my nginx config. how to apply it in openlitespeed
thanks in advance


/etc/nginx/site-enabled/domain2.conf

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.domain2.com.com;
ssl_certificate /etc/letsencrypt/live/domain2.comfullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain2.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain2.com/chain.pem
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline' 'unsafe-eval'; frame-ancestors 'self';" always;
add_header Permissions-Policy "interest-cohort=()" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
if ($request_method !~ ^(GET|POST|HEAD|PUT|DELETE)$) {
return '405';
}


## reverse proxy
location / {
proxy_pass http://127.0.0.1:8082;
proxy_redirect http://127.0.0.1:8082/ http://$host:$server_port/;
proxy_redirect ws://127.0.0.1:8082/api/socket ws://$host:$server_port/api/socket;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Forwarded $proxy_add_forwarded;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}


location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
}
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name .domain2.com;
ssl_certificate /etc/letsencrypt/live/domain2.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain2.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/domain2.com/chain.pem;
return 301 https://www.domain2.com$request_uri;
}

server {
listen 80;
listen [::]:80;
server_name .domain2.com;
location / {
return 301 https://www.tracksolid-eg.com$request_uri;
}
}
 
Top