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

cors blocked errors when loading iframe in vue component, maybe use axios to mimic iframe?

I’m doing some testing locally so my dev url is http://localhost:3000, I’m wanting to add an iframe into my vue component to bring in data from an outside domain. But I’m getting a cors errors being blocked, etc. I do have access to the domain and server I’m accessing so I have added <VirtualHost *:443> […]

Categories
Mastering Development

‘from’ parameter not supported c++ libcurl mailgun api

I’m trying to send a email with the mailgun api using c++ libcurl. The api is returning the error "message": "’from’ parameter is not a valid address. please check documentation". code CURL* curl; CURLcode res; std::string readBuffer; std::string user = "api:" + (std::string)"MY_API_KEY"; std::string data = "from=’from=’\"Bob Marley\" <bob@host.com>’&to=’jlkrumholz01@gmail.com’&subject=’Hello’&test=’hi’"; curl = curl_easy_init(); if (curl) { […]

Categories
Mastering Development

React and Node application not uploading Images to Cloudinary, 404 error with no explanation

I am trying to upload an image to cloudinary. I am using this resource as my tutorial… I am able to render a preview of the image onto my screen and I console log the base64 encoded url, and it works as it is supposed to. After I select my Image, I hit upload and […]

Categories
Mastering Development

No Access-Control-Allow-Origin after many calls edit > Axios network error catch

I’ve googled this issue very often and I think I’ve inserted them all which I know is redundant but I’m desperate. In my server I’ve added: app.use(cors()) and app.use(function (req, res, next) { res.setHeader(‘Access-Control-Allow-Origin’, ‘*’); res.setHeader(‘Access-Control-Allow-Headers’, ‘Origin, X-Requested-With, Content-Type, Accept’); res.setHeader(‘Access-Control-Allow-Methods’, ‘POST, GET, PATCH, DELETE, OPTIONS’); next(); }); and in the route, I’ve added: router.use([‘/api/’, […]

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

net::ERR_CONNECTION_REFUSED – Problem with CORS, Heroku App and NodeJS

i’m facing a ERR_CONNECTION_REFUSED on client-side, hosted on heroku app and my node back-end server, running in my PC. i have configured CORS on server.js this way: var express = require(‘express’) var cors = require(‘cors’) var port = process.env.PORT || 5000 var app = express() app.use(cors()); app.use(express.json()) app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*") res.header(‘Access-Control-Allow-Methods’, ‘GET,PUT,POST,DELETE’); […]

Categories
Mastering Development

PHP cors error with headers from Angular call

my endpoint has this: <?php header(‘Access-Control-Allow-Origin: *’); header("Access-Control-Allow-Credentials: true"); header(‘Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS’); header(‘Access-Control-Max-Age: 1000’); header(‘Access-Control-Allow-Headers: Accept,Origin, Content-Type, X-Auth-Token , Authorization’); … But with my Angular Call from Localhost, I get this error: Access to XMLHttpRequest at ‘https://example.com/createuser.php?api_key=123’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass […]

Categories
Mastering Development

Django + React Able to create new user in database, but token-auth returns 400 bad request

So I have an app that I’m writing. It’s working, for the most part, so far. I only currently have a login and signup setup, with a ‘homepage’ that just has a logout button and some text on it so I can test. When I do signup, it posts the user to the database, but […]