Try the fastest and simplest way to install ONLYOFFICE

Uploading Documents Fails

Uploading Documents Fails

Postby ThinkPrivacy » Mon May 25, 2015 2:27 pm

When I attempt to upload a document for a project, I get the following error:

Mixed Content: The page at 'https://mydomain.com/products/projects/tmdocs.aspx?prjID=2#7' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://mydomain.com/products/files/ChunkedUploader.ashx?uid=f03e6f77e75648128cc903f63d2ff4f5'. This request has been blocked; the content must be served over HTTPS.
send @ oKim7CqjEHleoSHzushXTw2.js:2

Any ideas how I can fix this please?
ThinkPrivacy
 
Posts: 20
Joined: Thu May 21, 2015 4:42 pm

Re: Uploading Documents Fails

Postby ThinkPrivacy » Mon May 25, 2015 11:26 pm

OK this only happens if I press the upload button next to "CREATE" drop down list. If I attach a file from the task page, it uploads no problem.
ThinkPrivacy
 
Posts: 20
Joined: Thu May 21, 2015 4:42 pm

Re: Uploading Documents Fails

Postby AnaMih » Tue May 26, 2015 12:41 pm

Please, specify how onlyoffice community server was installed? Did you follow this instruction? especially step 3 in "Installing ONLYOFFICE Community Server integrated with Document and Mail Servers" section and section "Running ONLYOFFICE Community Server using HTTPS".
Pay attention to the programs installation sequence:
1) Installing ONLYOFFICE Document Server.
2) Installing ONLYOFFICE Mail Server.
3) Installing ONLYOFFICE Community Server.
User avatar
AnaMih
 
Posts: 264
Joined: Mon Aug 25, 2014 10:15 am

Re: Uploading Documents Fails

Postby ThinkPrivacy » Tue May 26, 2015 7:15 pm

Yes I followed the guide to the letter.
ThinkPrivacy
 
Posts: 20
Joined: Thu May 21, 2015 4:42 pm

Re: Uploading Documents Fails

Postby jonzobot » Sat May 30, 2015 4:25 pm

I am having this same problem. I am only testing out the server on localhost. When I click the "Upload" button on the Documents panel, I get a generic "Error" without more. However, I am able to upload using the Tasks panel like the poster above. I also installed using the same guide.
jonzobot
 
Posts: 1
Joined: Sat May 30, 2015 4:24 pm

Re: Uploading Documents Fails

Postby AnaMih » Mon Jun 01, 2015 1:01 pm

to ThinkPrivacy:
Did you try restarting the monoserve? The downloading starts through http
Please, specify the certificate type (self-signed certificate?)

to jonzobot:
1) Check the domain name in the console (f12) after the request api/2.0/files/38/upload/create_session.json
Try opening the portal using this domain name

2) Check if there are the following lines in web.config (путь). If there are not, please, add these lines.
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Headers" value="Content-Type, Content-Range, Content-Disposition, Content-Description"/>
</customHeaders>
</httpProtocol>
User avatar
AnaMih
 
Posts: 264
Joined: Mon Aug 25, 2014 10:15 am

Re: Uploading Documents Fails

Postby rmx » Mon Dec 11, 2017 10:57 pm

Hello, got the same problem, and a long way to find a working solution...

So I installed OnlyOffice the Docker way, with the network bridge, mysql, DocumentServer and CommunityServer with mapped port: -p 8001:80 -p 8003:443 -p 8004:5222.

So the CommunityServer listens to the HTTP interface on the (internal) port 8001, and I've set up nginx as reverse proxy with a SSL certificate that proxy the communication to the CommunityServer, and here is the nginx vhost fix that bypass the ChunedUplader mixed-content bug:

Code: Select all
server {
   listen 443 ssl http2;
   server_name YOUR_ONLYOFFICE_DOMAIN;

   ssl_certificate ssl/YOUR_ONLYOFFICE_DOMAIN_CERT.pem;
   ssl_certificate_key ssl/YOUR_ONLYOFFICE_DOMAIN_CERT.key;

   location / {
      # Fix OnlyOffice mixed content problem with ChunkedUploader
      add_header Content-Security-Policy upgrade-insecure-requests always;
      add_header "Access-Control-Allow-Origin" "*" always;
      add_header "Access-Control-Allow-Methods" "POST, GET, OPTIONS" always;
      add_header "Access-Control-Allow-Headers" "Content-Type, Accept, Authorization, Origin" always;
      proxy_hide_header Access-Control-Allow-Origin;
      if ($request_method = "OPTIONS") {
         return 204;
      }

      # Allow WebSockets to work...
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      #proxy_set_header Connection $connection_upgrade; # /etc/nginx/maps/connection_upgrade.conf
      proxy_set_header Connection "upgrade";

      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $host;
      proxy_pass http://127.0.0.1:8001$request_uri;
   }
}


So it's this part that does the trick:

Code: Select all
      # Fix OnlyOffice mixed content problem with ChunkedUploader
      add_header Content-Security-Policy upgrade-insecure-requests always;
      add_header "Access-Control-Allow-Origin" "*" always;
      add_header "Access-Control-Allow-Methods" "POST, GET, OPTIONS" always;
      add_header "Access-Control-Allow-Headers" "Content-Type, Accept, Authorization, Origin" always;
      proxy_hide_header Access-Control-Allow-Origin;
      if ($request_method = "OPTIONS") {
         return 204;
      }


Hope this will hep you :)
rmx
 
Posts: 2
Joined: Mon Dec 11, 2017 5:46 am


Return to Documents

Who is online

Users browsing this forum: No registered users and 2 guests