When I tried to use delete method on nginx I get 403 access denied
<HTML>
<HEAD>
<TITLE>Access Denied</TITLE>
</HEAD>
<BODY BGCOLOR="white" FGCOLOR="black">
<H1>Access Denied</H1>
<HR>
<FONT FACE="Helvetica,Arial">
<B>
Description: You are not allowed to access the document you requested.
</B>
</FONT>
<HR>
</BODY>
I have searched configuration for any default block for delete method, but I can't find. I want to enable delete method in nginx, how can I do this?
UPDATE:
I don't log entry for delete alone but I can see for remaining all(get,post,patch,copy,head,unlink,put,options,link).
Related
i created project using BlippAR Web AR SDK to show simple 3D, for the first step, i think i'll use the template that BlippAR provided but change the *.glb only, but when i try to deploy to my hosting (cpanel), it shown this error
Refused to create a worker from 'blob:https://mywebsite.com/a043c781-5901-4d48-8726-bd3cf6bf37b3' because it violates the following Content Security Policy directive: "default-src * data: 'unsafe-eval' 'unsafe-inline'". Note that 'worker-src' was not explicitly set, so 'default-src' is used as a fallback. Note that '*' matches only URLs with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme matches self's scheme. The scheme 'blob:' must be added explicitly.
Here's the code that i used for this project
<html>
<head>
<title>WebAR SDK Basic Scene</title>
<script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
<script src="webar-sdk/webar-sdk-v1.4.4.min.js"></script>
</head>
<body>
<a-scene
webar-scene="key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
vr-mode-ui="enabled: false"
device-orientation-permission-ui="enabled: false"
loading-screen="enabled: false"
>
<a-camera webar-camera></a-camera>
<a-assets>
<a-asset-item id="chicken" src="models/chicken.glb"> </a-asset-item>
</a-assets>
<a-entity webar-stage>
<a-entity
gltf-model="#chicken"
id="chicken_1"
rotation="0 0 0"
position="0 0 0"
scale="0.25 0.25 0.25"
webar-loadmonitor="elType: glb"
></a-entity>
</a-entity>
</a-scene>
</body>
</html>
I'm pretty sure that my code is 100% correct. All the dependencies file, such as WebAR SDK, has been put in the right directory and called correctly from the script. So I guess the problem is from the SSL, so I tried to remove the SSL from my Cpanel the access now is from http://, but it's still not working, so I turned on the SSL back.
My expected result is the AR is working properly and can be accessed from my phone (safari/chrome)
Just to rule out any hosting problem, would you please try using the cdn link for the script source - https://webar-sdk.blippar.com/releases/1.4.4/webar-sdk-v1.4.4.min.js
Use:
<script src="https://webar-sdk.blippar.com/releases/1.4.4/webar-sdk-v1.4.4.min.js"></script>
If you choose to use existing script src as shown in your code, please try to use this meta tag in your html file and check:
<meta http-equiv="Content-Security-Policy" content="worker-src 'self' blob:;">
If this doesn't solve the problem, you should refer this CSP link as worker is blocked due to the server's Content Security Policy. You would have to change the CSP in your cpanel to allow blob: url .
https://content-security-policy.com/
Also, kindly share this issue on Blippar Developer Community on Slack for faster resolution - https://join.slack.com/t/blippardevelo-req1186/shared_invite/zt-yqkuhklz-rwjr_X_~DijAIpMj0Q7kMA
PS - Also, update your browsers.
Thanks!
I just started to host a web application on firebase.
the automatic setup with the firebase cli (firebase-tools) created a 404.html file in my public folder.
but i don't want to see a custom 404 error page nor the default one from firebase.
I would like to redirect all 404 to the startpage, so that the app will get initialised anyway. (my local setup with webpack-dev-server is just working fine)
a workaround is just to put the same content from index.html into the 404.html. But this leads into doubled maintenance..
i found some information about redirect configuration here https://firebase.google.com/docs/hosting/url-redirects-rewrites.
but a redirect for 404 error types isn't possible.
using a .htaccess file isn't possible.
am i missing the right location to change this behaviour whether in my firebase.json file or in the https://console.firebase.google.com/??
Not sure if this will work for you, I've never done stuff with .htaccess, but in my case I've always fixed it this way:
You can include a wildcard route as the last route in the rewrites section of your firebase.json file, so any previously unclaimed routes will match:
"rewrites": [
{
// route info here
},
{
// another route
},
{
// If it makes it here, it didn't match any previous routing
// Match all routes that get to this point and send them to the home page.
"source": "**",
"destination": "/index.html"
}
]
If you don't want to have original/non-existent url left (eg. https://example.com/asdf) you can modify 404.html source and replace it with js redirect.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Not Found</title>
<script>
window.location.href = "/";
</script>
</head>
</html>
I am trying spring MVC program and this is my directory structure when I run this program it works properly and when I hit the enter key and direct it to the next page i.e the action page.
it shows this page
HTTP Status 404 - /MVC_HelloWorld/hello.ap
type Status report
message /MVC_HelloWorld/hello.ap
description The requested resource is not available.
In my form action page I have written
this my inde.jsp page
<h1> Hello World</h1>
<form action="./hello.ap">
NAME: <input type="text" name="name">
<input type="Submit" value="Say Hello">
</form>
Is the problem with the path or directory structure is wrong?
The directory structure as I can see is correct. But the action you are setting in the form should be only the text like "hello.ap" it should not include / or ./ try with hello.ap and name the requestMaping in your controller to hello.ap.
i have written a script to upload all the files from a specific folder in local to the host, but there was some issue and the files are not getting uploaded to the host.
#!/bin/sh
for i in /main/folder_1/path/*
do
curl -u Pass:"Uname" -T $i http://www.example.com/folder/path/$i
done
echo "*****File Uplodaed ******"
help me to solve this. the following is the error, that i got
<html>
<head>
<title> 500 Internal Server Error </title>
</head>
<body>
<h1>
Internal Server Error
</h1>
</body>
</html>
currently i am having the script inside /main/folder_2, if i change /main/folder_1/path/ to ../folder_1/path/, i got the output as the files are moved. but i want to run the script with the complete path specified.
I have this in my controller:
if(some stuff) {
throw $this->createNotFoundException('message');
}
When I test it in dev env, I get the Symfony's page telling Exception detected with my text, but I can't test it in prod env :( I run this php app/console cache:clear --env=prod --no-debug and then replace only in the URL app_dev.php with app.php but the toolbar and Symfony's error page stay.
I created this file - app/Resources/TwigBundle/views/Exception/error.html.twig. So will it be rendered in prod?
This is in it:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>An Error Occurred: {{ status_text }}</title>
</head>
<body>
<h1>Oops! An Error Occurred</h1>
<h2>The server returned a "{{ status_code }} {{ status_text }}".</h2>
</body>
</html>
where should I give values for status_code and status _text? Or they are taken from the exception?
So in general what I want to do is when a condition in my contoller`s action is true, mine customized error page to be shown in prod env. Did I make it already, and if not, how to make it and how to see the result in prod env?
I also tried and i noticed that custom error pages placed in app/Resources/TwigBundle/views/Exception/error.html.twig worked only in prod environment.
Better late than never I guess..
You probably know about overriding of templates.
You can override any template you want.
So if you want to override the dev error page, just for debugging, then you should override the template:
exception_full.html.twig
You can do so by creating such a file in this folder:
app/Resources/TwigBundle/views/Exception
Now you will see your customized 404 in dev mode.
you can access your detected text with following way:
{{ exception.message }}
Read the doc http://symfony.com/doc/2.0/cookbook/controller/error_pages.html
and Customizing the 404 Page and other Error Pages
http://symfony.com/doc/2.0/cookbook/controller/error_pages.html#customizing-the-404-page-and-other-error-pages
It appears Symfony has a new way of allowing you to see the error page templates in your dev environment. Taken from their docs:
While you're in the development environment, Symfony shows the big exception page instead of your shiny new customized error page. So, how can you see what it looks like and debug it?
Fortunately, the default ExceptionController allows you to preview your error pages during development.
To use this feature, you need to have a definition in your routing_dev.yml file like so:
# app/config/routing_dev.yml
_errors:
resource: "#TwigBundle/Resources/config/routing/errors.xml"
prefix: /_error
Read more: Symfony Error Pages Manual