I have a problem here with sonata admin: can't create a new object of a certain model in production environment, but it does not throw any error or exception to track the problem. When I try to create with app_dev.php enabled everything works just fine.
Tried cleaning cache and all. Nothing happens.
I tried this solution too: Sonata Admin Bundle delete not working in prod
but the problem still persists.
Symfony 2.8 with Sonata Admin in Nginx Server. Other models work fine too.
Any help please? I have no clue where must be the problem :(
EDIT:
I got this in logs:
2018/03/15 13:55:43 [error] 12984#0: *11647 NAXSI_FMT: ip="LOLip"&server="lolmyweb.com"&uri=/admin/product/productlink/create&learning=0&vers=0.55.3&total_processed=13310&total_blocked=35&block=1&cscore0=$RFI&score0=8&zone0=BODY&id0=1101&var_name0=s5aaa7b4711a0e[link], client: 80.38.196.155, server: "lolmyweb.com, request: "POST /admin/product/productlink/create?uniqid=s5aaa7b4711a0e HTTP/1.1", host: "lolmyweb.com", referrer: "lolmyweb.com/admin/product/productlink/create"
No idea what that means...
I just commented the naxsi.rules line in my nginx.conf:
location / {
# include /etc/nginx/naxsi.rules;
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
Not really sure if I've done right tho :/
Related
I have two domains,
zerp.io (ssl installed)
app.zerp.io (only http)
in zerp.io (main domain) a wordpress website is hosted and is working fine. I am trying to deploy a React app on app.zerp.io using nginx. I deleted the default file and created new file app.zerp.io at /etc/nginx/sites-available/ I also created same file at /etc/nginx/sites-enabled/ and created a symlink between them. I checked the DNS entry, app.zerp.io and www.app.zerp.io is pointing to the public Ip of the correct server where React App resides.
Here's my /etc/nginx/sites-available/app.zerp.io file
server {
listen 80;
index index.html index.htm index.nginx-debian.html;
server_name www.app.zerp.io app.zerp.io;
location / {
proxy_pass localhost:3000;
proxy_ser_header host $host;
}
}
The problem is, whenever I try to reach http://app.zerp.io through web browser it redirects me to https://zerp.io. Here's what I did so far,
I checked DNS using an online tool, its correctly pointing to the server
I did not use any 301 redirects in the configuration file as you can see above
when I try curl app.zerp.io from the production server (in Germany), sometimes it gives 200 with correct response and sometimes it gives 301 (moved permanently) crazy isn't it
When I try curl app.zerp.io from my local computer it always give me 301 although I do not have any 301 in my nginx config file
I thought, may be its a cache issue on my chrome, to my surprise no, I cleared the cache and hard reload, I even tried incognito mode with no success, it always redirect me to https://zerp.io
When I try curl app.zerp.io from my local computer using a VPS it correctly opens the website app.zerp.io.
I do not have any ssl certificate so there are not redirects from http to https in http://app.zerp.io
Its been two days, Its making me crazy, I am assuming it has something to do with DNS resolution. Can some please help me out
Okay so:
I'm running a LightSail instance at www.gethatext.com.
FrontEnd - React, BackEnd - Django
On the homepage, I'm making 2 get requests to the Django server.
It is important to say that both Django & React are being served in the apache server.
.conf file of apache (http & https)
ProxyPass /api http://localhost:8000. # Django.
ProxyPassReverse /api http://localhost:8000 # Django.
ProxyPass / http://localhost:3000/. # React.
ProxyPassReverse / http://localhost:3000/. #React.
So I investigated and read that i need to add the following to the .conf file in either <Directory>, <Location> or <VirtualHost>. and so I did (and restarted all services of source).
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
BUT it did not help.
But when I'm making the same request from POSTMAN in my computer I get a the expected response (After running from the instance terminal python manage.py runserver 0.0.0.0:8000)
I Also added https://cors-anywhere.herokuapp.com to my request
So it looked like:
axois.get("https://cors-anywhere.herokuapp.com/https://gethatext.com/api/account/quantity/")....
and surprisingly IT WORKED..
But it doesn't feel like a good practice and also in terms of data privacy.
So I wonder what is it the problem here?
Is it related to that, that Django and React are both served in the same apache service?
Also add to axois header:
"Access-Control-Allow-Origin": "*"
But with no luck
Browser console error:
Cheers guys & Thanks in advnace.
So the solution for this one was
Adding:
"proxy" : "https:my-domain.com".
to the package.json and in the axios requests.
axios.get("/upload/quantity/").then()...
And it worked
Im trying to set up an SSL connection on my localhost XAMPP. Ive done this before, and had it working, but this time around I have trouble with the SSL connection I guess, cause I doubt its about the code since it was something that worked on before. And there have not been any changes since then. Im using virtual hosts with SSL on only one page. When I try and connect to it, it shows me an error on cakephp, but gives me no information about what the error is. Here is a Screnshot:
Also On my Xampp I have the next configuration for it to work with SSL:
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot "C:\xampp\htdocs\Bebe2go api"
ServerName bebe2goapi.com
SSLEngine on
SSLCertificateFile "C:\xampp\apache\conf\ssl.crt\server.crt"
SSLCertificateKeyFile "C:\xampp\apache\conf\ssl.key\server.key"
<Directory "C:\xampp\htdocs\Bebe2go api">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Im using a Shopify login plugin for the login and calls to Shopify. Right now its not working, but Im not sure why this is happeing. I dont think the error is on the code, but Ive tried quite a few options with no luck at all. Any ideas where I could start to look for a solution for this?
A quick side note here: The favicon from the page is being replaced by the Xampp favicon. Instead of the normal Cakephp icon which should show. Im not sure if this has anything to do with the trouble im haveing. But its worth noting.
If you need any more information please do ask :D
EDIT:
Acutally I just noticed, I get the next error on the cakephp errorlog:
2016-04-13 00:25:16 Error: [CurlException] SSL certificate problem: unable to get local issuer certificate
Request URL: /shopify/install?code=a547ef8d8ceb1470f89a23bd4318fa4d&hmac=c95ccf2fc00221b4e1f15acb645ab7009bcf99ba0bf2eb399c3e105184bdeaad&shop=bebe2go.myshopify.com&signature=f1df3f9788935385932ff577961dcf70×tamp=1460499916
Ok I just solved my problem, hehehe Apparently I was not pointing to the curl.cainfo from the php.ini wasnt pointing to the right direcction. This made the problem harder to solve cause the error didnt include a description for this error. All I had to do was put the right URL on the curl.cainfo in the php.ini from my xampp program and presto.
The rest was done right.
I recently bought a Namecheap domain and have been trying to hook it up to my GAE website. The GAE URL is domain.appspot.com and it works just fine. I have followed the instructions outlined in https://cloud.google.com/appengine/docs/domain but when I try to visit my custom domain I get an error saying:
The webpage at https://www.domain.com/ might be temporarily down or it may have moved permanently to a new web address.
Error code: ERR_CONNECTION_CLOSED
I have no idea what I'm doing wrong. I have confirmed that domain.com and www.domain.com are both listed as custom domain names in the GAE console, and I've added all the IPs/CNAME stuff as specified. A dig domain.com command confirms that:
;; ANSWER SECTION:
domain.com 1234 IN A 216.239.34.21
domain.com 1234 IN A 216.239.36.21
domain.com 1234 IN A 216.239.32.21
domain.com 1234 IN A 216.239.38.21
I'm wondering if this is a HTTPS issue because trying domain.com in Safari tells me that:
Safari can't open "https://domain.com" because Safari can't establish a secure connection to the server "domain.com".
I don't want to get a cert for HTTPS but I don't see any way around the problem? How can I successfully use a custom domain with my GAE app?
The problem was in my app.yaml file. I had set secure: always which was forcing https, but I didn't have a cert. Now I changed it to secure: never to require http, and it should work fine.
Has anyone cracked how to get HTTPS working on the dev_appserver.py? I need it for Facebook canvas app testing. I've had a search of the docs and nothing suggests there's a way to do it (sticking 'secure' in the app.yaml doesn't nothing locally).
I was think there may be a way to proxy it, but has anyone got any experience of this?
The dev_appserver doesn't support HTTPS. The only practical way to do this is to set up a reverse proxy in front of your app - such as with nginx or Apache - and have it proxy SSL traffic to your app.
I know this is late, in case anybody else finds this question:
ngrok is quiet easy to setup for a custom reverse HTTPS proxy..
The only downside is that my webapp2 application still believes it's being served over HTTP, so using redirect() doesn't work well because it resolves relative URLs to absolute URLs using request.url.
My workaround was to overwrite RequestHandler.redirect as follows:
class BaseRequestHandler(RequestHandler):
def redirect(self, uri, permanent = False, abort = False, code = None, body = None):
if uri.startswith(('.', '/')):
base_url = self.request.url
if base_url.startswith('http://'):
base_url = 'https://' + base_url[7:]
uri = str(urlparse.urljoin(base_url, uri))
super(RequestHandler, self).redirect(uri, permanent, abort, code, body)
I needed a BaseRequestHandler class anyways for implementing other utility functions.
I put this in my Appache httpd.conf to proxy the connection:
<Location /myproject/>
ProxyPass http://localhost:8080/
</Location>
Now going to https://localhost/myproject/ in my browser worked.
Note: SSL needs to be enabled on your Apache server. On my OS X machine I uncommented out the line Include /private/etc/apache2/extra/httpd-ssl.conf in /etc/apache2/httpd.conf and ran sudo apachectl restart