How to enable CORS on Plesk 11.5? - centos

We are hosting websites on a server with CentOS and Plesk. For one of the websites we would like to enable CORS for a partner that wants to show specific content from our website on his own website.
How do I have to proceed for that and is CORS really save? I read some tutorials but they were to common to help me.
Again our server information:
Server: CentOS
Admin software: Plesk 11.5
CMS: Contao
Our partner only wants to grab content from our website, there is no other interaction needed (sending data over our website e.g.).
Thank´s for your help!

You can add custom web server directives at domain's "Web Server Settings" page.
There is "Additional Apache directives" and "Additional nginx directives"
For example, to add "Access-Control-Allow-Origin" header for nginx you need "add_header", as described in docs http://nginx.org/en/docs/http/ngx_http_headers_module.html it can be applied to http, virtual server or location.
So, you just can add following string at "Additional nginx directives":
add_header Access-Control-Allow-Origin *;

Related

Make 'http' request from Github-pages 'https' hosted site

I've hosted my webapp to Github pages, thus website is on 'https'. But now, I want it to make a 'Http' request to some external site.(I don't have a custom domain to change hosted site to http.)
I'm getting the 'Mixed-content' error -
Mixed Content: The page at 'https://username.github.io/MyHostedSite/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://someHttpApi'. This request has been blocked; the content must be served over HTTPS.
Is there a way to proxy this so I can do a 'http' request over 'https' ?
Get a custom domain, and do DNS with Cloudflare (free)
… you can turn https on at Cloudflare (in page rules) — then you don't have to worry about github's http/https settings and mixed content errors.
There are good instructions for setting up a custom domain with github pages, you can see it here: Custom domain for GitHub project pages
You just have to decide if you want to serve your site at the apex domain, or with the www subdomain:
http://example.com
vs
http://www.example.com
page rules at Cloudflare look like this:

301 Redirect and HTTPS

OK, please go gentle on me as I am a bit of a beginner when it comes to domains.
My old website was hosted by Squarespace and the Domain provided by GoDaddy and was set up to use SSL (by ticking that option within the Squarespace settings). For this example, let's say the domain was myoldsite.co.uk
This site is now closed down and no longer active on Squarespace.
All of my backlinks over the last 3 years have been created for https://myoldsite.co.uk
Recently, I have created a new Wordpress site again using SSL using the domain name: https://mynewsite.co.uk
Within the GoDaddy admin console for myoldsite.co.uk, I have created a 301 redirect going to https://mynewsite.co.uk
This is working well when I enter http://myoldsite.co.uk, I am forwarded to https://mynewsite.co.uk
However, when I enter https://myoldsite.co.uk, nothing happens and I am not forwarded.
So I have 2 questions:
Is it posible for all old backlinks created using https://myoldsite.co.uk to correctly forward?
By creating the 301 redirect, does this work at the domain level and http / https is not relevant when passing down all the SEO juice?
Thanks in advance,
Duncs

web hooks face books how to bypass a secure website

I am setting a webhooks for a Facebook application, and they required a call back url, this url must be in https
I do have a server with a call back website but it is not https, it is in http protocol
Any idea to bypass that? (work around? )
There's no way to bypass it.
However, if you don't want to buy SSL certificate for your domain, you can configure your domain name with CloudFlare and use their universal ssl.
I have used it with facebook webhooks and it works very well. It's free and very easy to configure.
The free plan allows you to use Flexible SSL. As per the docs:
Flexible SSL: secure connection between your visitor and CloudFlare, but no secure connection between CloudFlare and your web server. You don't need to have an SSL certificate on your web server, but your visitors still see the site as being HTTPS enabled.

Drupal IP/domain redirect

I recently redid a client's old Drupal site, in Apostrophe, and pointed their domain to the new server.
I am now trying to access the old site via IP address, but there seems to be a redirect configured to rewrite the base IP address to the domain name (72.xx.xxx.xxx to www.clientdomain.com).
Is there something configured in Drupal to rewrite the IP address? Can I change a field in the database or configuration files to prevent this?
I have ssh access to the server, and have poured over the Drupal code, settings.php, .htaccess, etc., but cannot locate this offending field. I am not familiar with Drupal, but suspect it could be an admin setting. Since the site redirects, I am unable to login to the admin backend.
Any and all insight is appreciated. Thanks for your help!
A few possibilities:
In the settings.php (sites/default/settings.php), see if there is a $base_url set. If you can see any, comment that line. You can run a drupal site without the base_url hardcoded in the settings.php
In the .htaccess look for redirects. Your safest bet is to replace it with a fresh file downloaded from http://drupal.org/project/drupal
The most likely case is that your web server is configured to redirect the IP address to the main domain.
You can also access your site at old server by explicitly setting the IP address in your hosts file. Check it for your operating system DNS resolver docs.

Dynamics CRM Email Router not using proxy

I am trying to set up the CRM Email Router to allow our internally hosted ADX Studio Portal to communicate with our externally hosted Dynamics CRM instance.
I have set up the Configuration profile to meet the requirements of our exchange server and created a deployment to an online service provider with the necessary details.
When I attempt to load the data the Email Router Config Manager states that it was unable to retrieve the data:
Metadata contains a reference that cannot be resolved:
'https://CRM.URL/XrmServices/2011/Discovery.svc?wsdl
When we traced the email router with Fiddler the request receives a 407 Proxy Authentication Required message:
Your credentials could not be authenticated: "Credentials are
missing."
We have tested the Email Router tool on a personal network (with no proxy requirements) and everything works correctly. However once we are on the internal network which requires the proxy the Email Router Config Manager no longer works.
We have tried using the Dynamics CRM SDK and and the crmsvcutil.exe command line tool but are not sure how it actually tells the Email Router what configuration to use.
Any help is greatly appreciated. Thanks.
The only way to resolve this is to add an authentication bypass on proxy server for the server and/or service account of the email router.
You can try add section to email router .config file, with proxy settings. This is .net app, so it should pick it up. I never tried this for email router, but might be worth a shot. look here for details
The answer we received from a MS support technician was "you need to ensure that the proxy will let through (without any modification) any requests to the CRM Web Service”.
We also tried modifying the .config file to include the proxy settings but it didn't work.
We are going to open an official case with MS. Will let you know if we ever get it working.