Categories
Mastering Development System & Network

Nginx as a chain proxy with stunnel+pproxy+tor for add|set http headers responds with 400 status code

My initial goal is creating working http(ssl) proxy based on TOR socks5 connection first I up python-proxy with self-signed key then chained stunnel for securing connection, it works but cannot handle wss connection and seems like needs this headers patch ‘Access-Control-Allow-Origin’ ‘*’ … I didn’t find info how to do that using stunnel config, so […]

Categories
Mastering Development System & Network

Nginx reverse proxy and a URL rewrite

I would like to rewrite the URL in a reverse proxy so that it removes the first segment but leaves any following segments intact. I need this to happen before it hits the proxy pass. Example: /admin/auth/local —-> (REWRITES TO) /auth/local /admin/auth/register ——-> (REWRITES TO) /auth/register My Location block: location /admin { #add_header Access-Control-Allow-Origin *; […]

Categories
Mastering Development System & Network

ERR_CERT_COMMON_NAME_INVALID on chrome

When trying to login to my website on Chrome based browsers I get the error: Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID On firefox it works fine, tho. I installed certificates by certbot. My corresponding nginx settings look like: server { listen 80; server_name pvapp.umwelt-campus.de; return 302 https://$server_name$request_uri; } server{ # SSL configuration listen 443 ssl default_server; […]

Categories
Mastering Development System & Network

Angular CORS with Nginx

Several questions for the same topic on the net but nothing worked. I have a serverXYZ running an Angular app, a backend tomcat webapp for authentication, a nginx server. Angular app on port 4200, tomcat app on 8080. Everything is on the same host. The angular app has a environment.ts file (the commented string is […]

Categories
Mastering Development System & Network

Nginx – Unable to fix CORS error on HTTPS – only works for http

I have a website running on a Nginx + Php-FM + Redis Stack . Was getting some CORS warnings and added the following to my nginx config : location / { if ($request_method = ‘OPTIONS’) { add_header ‘Access-Control-Allow-Origin’ ‘origin-list’; add_header ‘Access-Control-Allow-Origin’ ‘*’; add_header ‘Access-Control-Allow-Methods’ ‘GET, POST, OPTIONS’; # # Custom headers and headers various browsers […]

Categories
Mastering Development System & Network

502 Bad Gateway when uploading files (NGINX and NodeJS)

502 Bad Gateway when uploading pics (NGINX and NodeJS) Hey Guys. Please help me out, I am pulling out my hair in frustration trying to fix this. So here is the issue. I am developing an app where the user can upload files. While the backend call seems to work fine, the call when uploading […]

Categories
Mastering Development System & Network

nginx: [emerg] “index” directive is not allowed here

I tried nginx -t and everything seems right. I get this error: nginx -c /etc/nginx/sites-available/premonstrati2021.cz -T nginx: [emerg] "index" directive is not allowed here in /etc/nginx/sites-available/premonstrati2021.cz:1 nginx: configuration file /etc/nginx/sites-available/premonstrati2021.cz test failed My config file is this: index index.html index.htm; server { listen 80; listen [::]:80; server_name premonstrati2021.cz; #port_in_redirect off; #proxy_set_header Host $host:$server_port; # if […]

Categories
Mastering Development

Same-origin request causes “Access-Control-Allow-Origin doesn’t match” error, though origin of course matches. Note: has CSP policy w/ “sandbox”

When the exact same URL is being used in both by CORS and its web pages’ URL, I still get the same error messages in my Firefox development console. Browser console messages were: Cross-Origin Request Blocked: \ The Same Origin Policy disallows reading the remote resource \ at https://egbert.net/fonts/fontawesome-webfont.woff2?v=4.7.0. \ (Reason: CORS header ‘Access-Control-Allow-Origin’ does […]

Categories
Development System & Network

Getting full rest HTTP methods to work with nginx index directive

I’ve been trying to update my API to be fully REST compliant, and I haven’t been able to get DELETE, PUT, OPTION etc to work with the index directive. I’ve tried every config I can find on here and I can’t figure out what I’m doing wrong. The methods work fine if I do the […]

Categories
Development

How to check if a video or an audio stream is online or not in Vbscript?

I wonder what is the parameter or the value to look for to check if a video or audio stream is online or not in vbscript ? So this what i have tried as code until now, but, it give me a wrong results, because i have checked all those streams with VLC and they […]