Issue with reqirep param in haproxy configuration - url-rewriting

My current url is
http://10.24.23.20/textr/mine.php
and through haproxy rewrite url, I want to transfer that to
http://10.24.23.20/#/textr/mine.php`
for this I used following reqirep rules and none worked
reqirep ^([^\ ]*)\ /textr/(.*) \1\ /\#/textr/\2
reqirep ^(\b\w{4}://10.24.23.20/)\ (\btextr/.*) \1\#/\2
First one converts the url like http://10.24.23.20/textr/mine.php#/
second one simply fails to do anything.
Can someone please help me out on the issue.

I posted the question without proper research.. First transformation format I mentioned in the question itself worked fine..
reqirep ^([^\ ]*)\ /textr/(.*) \1\ /#/textr/\2
Mistake was that I incorrectly added spaces in between in my haproxy.cfg file. Once I clear that all started working and the URL is transformin with # inbetween the server and base folder

Related

Supabase Add additional redirect URL not working

I'm trying to set up auth in supabase
Following the tutorial, I try adding domain 'io.supabase.flutterquickstart://login-callback/'
but nothing happens. Maybe this is a bug in the software, not sure
I already commented on the Github issue but for reference here as well:
Maybe a hint because I tripped over this twice now in 3 days. Make sure you have a slash at the end of the URL in the additional Redirect URLs and check the API call sent to supabase to compare.
My problem was that the first localhost address works, but the second doesn't because of the missing slash. If it doesn't find the exact URL, it defaults to the "Site URL" address:

snipe-it with XAMPP

I have configured snipe-it following https://snipe-it.readme.io/docs/configuration and I don't seem to get pre-flight to run/launch and there is no instructions on snipe-it website unless I have missed it. I tried to use URL (http://localhost/setup) that I setup in the .env file but it says "This site can not be reached". I also tried IP but no luck. Any one out there have any idea what configuration file I need to check and how to launch it? Thank you all

Follow up - Configuring MODx Revolution to work with both http and https

This question is follow-up for this topic:
Configuring MODx Revolution to work with both http and https.
For even more details see this
MODX forum post
I face the same problem as described there and I use suggested solution. Just in my case I found the situation when it does not work.
I use MODX extra called FormIt (you probably know it) - it processes the forms and then redirects to 'thank you' page. What I have problem with is this redirect. It also uses makeUrl() but the snippet mentioned in the original post does not help here because in FormIt class the whole context config is regenerated, so site_url contains again [[++url_scheme]] and redirect ends in address like:
https://www.example.com/[[++url_scheme]]www.example.com/[[++url_scheme]]www.example.com/thank-you-page.html
instead of
https://www.example.com/thank-you-page.html
I wonder if you could know about some workaround, please?
thank you in advance!
Succeeded to resolve the issue.
What helped was to create new hook which does something like:
$modx->config['site_url'] = $modx->config['url_scheme'] . substr($modx->config['site_url'], strlen('[[++url_scheme]]'));
and then add this hook right before redirect hook in FormIt call

HAProxy - URL Rewrite

Requesting help to rewrite the following url.
/test/%2012341234 to /test/12341234. I tried the following. But it din't work.
reqirep ^([^\ ])\ /test/%2012341234(.) \1\ /test/12341234\2
Any help would be appreciated. Thank you.
Without the whole context, it's hard to answer you.
Furthermore, HAProxy version, and whole anonymized configuration is welcome too!
That said, in your particular example, this should do the trick:
reqirep ^([^\ ]\ /test/)%20(12341234.*) \1\2
note that reqirep won't work in tunnel mode.
So you must have at least option http-server-close, httpclose or forceclose in your configuration.
Baptiste

Upload images problem: IO error. (Error #2038)

I'm using script which is uploading files to server via flash component. Sometimes, very rarely, when trying to upload images via Firefox I get following error: IO error #2038. Searching on the net I could find reason why is it really happening to me. But I found solution for my case:
I open IE6, do the same thing there (photos are always uploaded without problem) and the when I try again in Firefox problem disappears. If someone had similar problems maybe this could help or maybe this hint could help to someone discovering cause of the problem :)
I just had this error also using ASP.Net MVC and I discovered I just had my handler namespace wrong/missspellled in the web config section where the handlers go. HTH...
After far more time than I'd like to admit, here is the solution. Change the following variables in your php.ini to be large enough to handle your largest file:
; Maximum size of POST data that PHP will accept.
post_max_size = 32M
; Maximum allowed size for uploaded files.
upload_max_filesize = 32M
; Whether to allow HTTP file uploads. (this is on by default)
file_uploads = On
Since files are sent as POST data, both the first variables need to be set. Otherwise, there will be an error, but you won't see what the error is, except IO error #2038.
If you didn't add quote around the option names, try doing that. Sometimes in IE, quoting the option names fixes the issue. It would help if you posted some example code though.
Also make sure that the path to the server being used by the upload component is correct. If the path is a relative path, try to fully qualify it. IE can do some "magic" with relative paths that the other browsers cannot do, and sometimes trying the code from one browser to the other can tweak things.
Also, could be permissions...and having IE go there first could manipulate the permissions in a way that the other browser(s) then work "correctly".
I solved the problem.
In my office I use a proxy and I must change the settings to No Proxy.
Or if you do not use proxy, try to change in php.ini:
Hostname:Port localhost:0
to:
Hostname:Port localhost:80

Resources