I use Amazon's S3 and CloudFront for assets delivery. I have specified CORS configuration at S3 bucket:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
</CORSConfiguration>
So when I open app using http it's ok. But when I open it using https it says
Origin https://<app-domain> is not allowed by Access-Control-Allow-Origin.
Am I missing something?
I found that this is CloudFront bug. It caches first origin that accesses S3 and doesn't allow another origins in future. As a workaround this can be used.
Related
It looks like I cannot upload more than 2mb file with heroku.
I can upload 3mb file on my local but I can't upload the same file after pushing to heroku. (Using storage S3)
I updated the htaccess file and I have added
ini_set('upload_max_filesize', '64M');
to my controller but it doesn't work.
Is there a way we can change the php.ini setting on heroku?
you need to create .user.ini file in root directory
post_max_size = 25M
upload_max_filesize = 25M
then also updated .Procfile for apache
web: vendor/bin/heroku-php-apache2 -i user.ini rootDirectoryName/
for more information read this blog and official documention
Had a similar issue, I was googling and trying many solutions, but nothing helped, so I've decided to switch from Apache to NGINX and the problem was solved - https://stackoverflow.com/a/69509235/7092969
Overriding Heroku PHP ini files is kinda complicated and official Herkou documentation did not help me at all :/
i'm running a laravel project in docker, i'm uploading file on amazon s3 but when i upload file bigger than 5mb i get this error
1
i've already edited the nginx.conf file with
client_body_buffer_size 400M;
client_header_buffer_size 400M;
large_client_header_buffers 4 400M;
client_max_body_size 10G;
Someone can explain me?
I want to use xmlstartlet within a Bash task in Azure DevOps to edit the below XML.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
I want to make this code to the below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxyEndpoint name="default">
<PostFlow name="PostFlow">
<Request>
<Step>
<Name>EV-ExtractParameters</Name>
</Step>
</Request>
<Response/>
</PostFlow>
But stuck at getting to install XMLstarlet in the build server. Has anyone been able to use this in Azure DevOps Bash task?
I have tried to use an agent demand, but that didn't work.
In the Microsoft Hosted agents the xmlstarlet tool not installed in the machine, so you can't just use it.
You need to add a Bash task to install the tool, then you can use it.
Example in the .yaml pipeline to the Bash task:
-bash: |
sudo apt-get install xmlstarlet
Then use it with the command xmlstarlet [<options>] <command>.
I am deploying a laravel app with dokku and it deploys the app perfectly. The only issue is the famous /public problem. I need to change the nginx configuration inside the container somehow to make it point out to the correct directory. I found this instruction about nginx configuration in dokku but it doesn't give information about changing the root directory of an app.
I needed to make a Procfile containing:
web: vendor/bin/heroku-php-nginx public/
I edited context path in TomCat server.xml, so that my webapps/app is displayed as root app instead of TomCat app on mysite.com (not mysite.com/app). In my app i have some .jsp files that are displayed correctly (mysite.com/main, /register) but some sites give me 404 error (mysite.com/home, /rxmsg, /signout).
Yet when i go to mysite.com/app/home, everything works perfectly
Every URL like this works perfectly in local (localhost:8080/home)
My git pushes are transfered to tomcat_home/webapps/ via jenkins
What causes some urls to 404?
Redirects are made by
return "redirect:main"; //URL is changing
or
return "main"; //URL not changing
I managed to find the problem
In my tomcat server.xml changed
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
to
<Host name="mysite.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
and restarted my service.
BUT doing so, I cannot test my code on localhost now.
Simply create both Host tags and set localhost as the default host in the Engine tag:
<Engine defaultHost="localhost" ...