React Nginx Proxy Pass every file loading index.html - reactjs

I've been scouring trying to find a solution, but when I go to my domain, all my static files are just returning index.html, giving me a
Uncaught SyntaxError: Unexpected token '<' error
My setup is this:
A server that runs nginx for multiple domains, with the one site in question having the following config file
server {
listen 80;
listen [::]:80;
server_name domain.com www.domain.com;
return 302 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/domain/cert.pem;
ssl_certificate_key /etc/ssl/domain/key.pem;
server_name domain.com www.domain.com;
location / {
proxy_pass http://10.0.0.41:80;
}
location /api {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.0.0.41:3000;
where 10.0.0.41 is another server which is hosting 2 docker containers, one for my react app/nginx and one for my express backend app.
The reverse proxy to the express app works perfect, but when I try to visit domain.com, my js files are returning as index.html and not loading, giving me the error above.
When I visit 10.0.0.41 in my browser, everything loads as it should and works correctly, just not when coming from the domain.
this is the nginx config file for the second server
server {
listen 80;
listen [::]:80;
root /usr/share/nginx/html;
location / {
try_files $uri /index.html;
}
location ~ .(static)/(js|css|media)/(.+)$ {
try_files $uri $uri/ /$1/$2/$3;
}
}
I've tried everything I can find, adding that last line in the 2nd nginx config, removing, adding, changing homepage in package.json.
I am using React router, with <Route exact path="/"
This has been driving me crazy and any help would be greatly appreciated, and if I left out any important information let me know.
Difference in requests:
10.0.0.41:80
10.0.0.142 - - [02/Aug/2022:13:42:53 +0000] "GET / HTTP/1.1" 200 644 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "-"
10.0.0.142 - - [02/Aug/2022:13:42:53 +0000] "GET /static/css/main.69847ccd.css HTTP/1.1" 200 2261 "http://10.0.0.41/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "-"
10.0.0.142 - - [02/Aug/2022:13:42:53 +0000] "GET /static/js/main.10f72de5.js HTTP/1.1" 200 514201 "http://10.0.0.41/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "-"
10.0.0.142 - - [02/Aug/2022:13:42:53 +0000] "GET /static/js/423.0a0d8ebb.chunk.js HTTP/1.1" 200 3280 "http://10.0.0.41/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "-"
10.0.0.142 - - [02/Aug/2022:13:42:53 +0000] "GET /favicon.ico HTTP/1.1" 200 3150 "http://10.0.0.41/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "-"
www.domain.com
10.0.0.101 - - [02/Aug/2022:13:44:37 +0000] "GET / HTTP/1.1" 200 644 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "my_ip, cloudflare_ip"
10.0.0.101 - - [02/Aug/2022:13:44:37 +0000] "GET /manifest.json HTTP/1.1" 304 0 "https://www.my_domain.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "my_ip, cloudflare_ip"
10.0.0.142 is the machine i'm testing with, 10.0.0.101 is the first nginx server

Related

Proxying react app using nginx on docker-compose

I am trying to use docker-compose to run 2 containers - a sample react app and an nginx to behave as reverse-proxy.
I've ran npx create-react-app react-app to create the first container, and added the following Dockerfile to the folder -
FROM node
RUN yarn global add serve
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn
COPY . ./
RUN yarn build
CMD serve -s build
I've then proceeded to create the following nginx configuration file under ./nginx -
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /react {
proxy_pass http://react:5000;
}
}
Finally, I've created this docker-compose.yaml file in the root of the project -
version: '3'
services:
nginx:
image: nginx:latest
container_name: production_nginx
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80
- 443:443
react:
build: ./react-app
container_name: react-app
expose:
- "5000"
ports:
- 5000:5000
I then use docker-compose up --build to launch my stack, but when I use the http://localhost/react path I get the following errors in my nginx access logs -
eact-app | INFO: Accepting connections at http://localhost:5000
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:29 +0000] "GET /react HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 2020/01/29 18:24:29 [error] 7#7: *1 open() "/usr/share/nginx/html/static/css/main.d1b05096.chunk.css" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /static/css/main.d1b05096.chunk.css HTTP/1.1", host: "localhost", referrer: "http://localhost/react"
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:29 +0000] "GET /static/css/main.d1b05096.chunk.css HTTP/1.1" 404 555 "http://localhost/react" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:29 +0000] "GET /static/js/2.250dc4af.chunk.js HTTP/1.1" 404 555 "http://localhost/react" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:29 +0000] "GET /static/js/main.de4c6317.chunk.js HTTP/1.1" 404 555 "http://localhost/react" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 2020/01/29 18:24:29 [error] 7#7: *4 open() "/usr/share/nginx/html/static/js/2.250dc4af.chunk.js" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /static/js/2.250dc4af.chunk.js HTTP/1.1", host: "localhost", referrer: "http://localhost/react"
production_nginx | 2020/01/29 18:24:29 [error] 7#7: *3 open() "/usr/share/nginx/html/static/js/main.de4c6317.chunk.js" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /static/js/main.de4c6317.chunk.js HTTP/1.1", host: "localhost", referrer: "http://localhost/react"
production_nginx | 2020/01/29 18:24:29 [error] 7#7: *5 open() "/usr/share/nginx/html/manifest.json" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /manifest.json HTTP/1.1", host: "localhost", referrer: "http://localhost/react"
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:29 +0000] "GET /manifest.json HTTP/1.1" 404 555 "http://localhost/react" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 2020/01/29 18:24:34 [error] 7#7: *3 open() "/usr/share/nginx/html/static/js/2.250dc4af.chunk.js" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /static/js/2.250dc4af.chunk.js HTTP/1.1", host: "localhost", referrer: "http://localhost/react"
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:34 +0000] "GET /static/js/2.250dc4af.chunk.js HTTP/1.1" 404 555 "http://localhost/react" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 172.18.0.1 - - [29/Jan/2020:18:24:34 +0000] "GET /static/js/main.de4c6317.chunk.js HTTP/1.1" 404 555 "http://localhost/react" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36" "-"
production_nginx | 2020/01/29 18:24:34 [error] 7#7: *4 open() "/usr/share/nginx/html/static/js/main.de4c6317.chunk.js" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /static/js/main.de4c6317.chunk.js HTTP/1.1", host: "localhost", referrer: "http://localhost/react"
It seems to me like nginx is looking for Reacts static assets in the nginx container, but I'm not sure why doesn't it proxy these requests over to the react container. Any idea how to solve this?
I haven't used nginx to reverse proxy to my front end. Only to connect requests from my front end to my server. Instead, you might try hosting your react-app directly through nginx. Here is one way that I have done this.
Instead of running two containers, I set up a Dockerfile in the root of my react-app. The Dockerfile does a production build of the react app and then copies it into nginx to be hosted at the / route in your nginx configuration. This is what that file looks like.
# Frontend build based on Node.js
FROM node:11.12.0-alpine as build-stage
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install react-scripts#latest -g
COPY . /usr/src/app
#RUN CI=true npm test
RUN npm run build
# Stage 1
# Production build based on Nginx with artifacts from Stage 0
FROM nginx:1.15.9-alpine
COPY config/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /usr/src/app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
In the root of the react-app I also have a config directory. Inside that directory I have nginx.conf file which looks like this.
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
# redirect server error pages
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Since the frontend build is copied into nginx in the first step, it can now find the build directory inside it's own file system. After that, you can build and run the image in a container and everything should build properly. I think all you would have to do at that point is move your docker-compose.yml file into the react-app root, get rid of the react service, change image: nginx:latest to build: . and run docker-compose up -d. You could also forgo compose and just use docker by running docker build -t react-app and after that builds, run docker run -d -p 80:80 react-app in the root of the react-app directory. This is a very simple way to get started and perhaps not quite what you were looking for. Hope it helps though.
After finding this great blogpost I managed to solve the issue by changing the nginx configuration to this -
upstream backend {
server react:5000;
}
server {
listen 80;
server_name localhost§
root /usr/src/app;
location / {
try_files $uri #backend;
}
location #backend {
proxy_pass http://backend;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Following is necessary for Websocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

Request to api server(Golang) via nginx failed and returned 404 error

I'm setting up nginx in docker environment.
When I try to access to api server via nginx port, request returns 404 error.
Here is the stack.
・client: react/axios
・api: golang/gin
・web server: nginx
・db: mysql
・container: docker
・ci-tool: travis
・deploy: aws elastic beanstalk
Entire source code is here:
https://github.com/jpskgc/article
article
├ client
│ └ nginx
│ └ default.conf
├ api
├ nginx
│ └ default.conf
└ docker-compose.yml
Here is docker-compose.yml.
//docker-compose.yml
version: '3'
services:
nginx:
restart: always
build:
dockerfile: Dockerfile.dev
context: ./nginx
ports:
- '3050:80'
depends_on:
- client
- api
api:
build:
dockerfile: Dockerfile.dev
context: ./api
volumes:
- ./api:/app
depends_on:
- db
tty: true
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- MYSQL_USER
- MYSQL_PASSWORD
- MYSQL_HOST
client:
build:
dockerfile: Dockerfile.dev
context: ./client
volumes:
- /app/node_modules
- ./client:/app
Here is default.conf.
//default.conf
upstream client {
server client:3000;
}
upstream api {
server api:2345;
}
server {
listen 80;
location / {
proxy_pass http://client;
}
location /sockjs-node {
proxy_pass http://client;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location /api {
rewrite /api/(.*) /$1 break;
proxy_pass http://api;
}
}
Also there is default.conf in client.
server {
listen 3000;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
I expect nginx reverse proxy to port 2345 api server.
But the actual returns 404 response.
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:06 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:06 +0000] "GET /static/js/bundle.js HTTP/1.1" 304 0 "http://localhost:3050/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:07 +0000] "GET /static/js/0.chunk.js HTTP/1.1" 304 0 "http://localhost:3050/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:07 +0000] "GET /static/js/main.chunk.js HTTP/1.1" 304 0 "http://localhost:3050/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:07 +0000] "GET /static/js/bundle.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:08 +0000] "GET /static/js/0.chunk.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:08 +0000] "GET /static/js/main.chunk.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
api_1 | [GIN] 2019/08/09 - 22:19:09 | 404 | 41.937µs | 172.23.0.5 | GET /articles
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:09 +0000] "GET /api/articles HTTP/1.1" 404 18 "http://localhost:3050/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:10 +0000] "GET /sockjs-node/info?t=1565389150444 HTTP/1.1" 200 90 "http://localhost:3050/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
nginx_1 | 172.23.0.1 - - [09/Aug/2019:22:19:10 +0000] "GET /manifest.json HTTP/1.1" 304 0 "http://localhost:3050/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" "-"
Also when accessing to actual deployed url, it returns 502 Bad Gateway now.
http://multidocker-env.vwnrixavuv.ap-northeast-1.elasticbeanstalk.com/api/articles
As Enix suggested on comment, after removing rewrite directive, issue is resolved.
rewrite /api/(.*) /$1 break;

Why does my code uncomment this part of the code out

So I've been making a simple HTTP flooder with a Wget and a user agent but when flooding i realize this happens
125.27.78.172 - - [26/Apr/2016:12:38:45 -0500] "GET / HTTP/1.1" 403 4961 "-" "Wget"
And if you are confused about this error i asked my friend to flood my VPS and this happend
208.67.1.176 - - [26/Apr/2016:12:48:32 -0500] "GET / HTTP/1.0" 403 4961 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36"
Why is is it not working with me code:
sprintf(command, "wget -O /tmp/fff --header="Accept: text/html" --user-agent="Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36" http://208.67.1.176/ ");
if you're wondering how this is a flooder the main code loops it
Escape the string?
sprintf(command, "wget -O /tmp/fff --header=\"Accept: text/html\" --user-agent=\"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.85 Safari/537.36\" http://208.67.1.176/ ");

Apache Forbidden on Virtual Directory

I have been trying to configure my Apache to list the log files that are stored in /var/log/squid/ so that I can download them from the server to my local PC if required. I have configured the Alias as follows;
Alias /squid/ "/var/log/squid/"
<Directory "/var/log/squid/">
Options None
AllowOverride All
Order allow,deny
Allow from all
</Directory>
But I keep getting the 403 Forbidden error message when I try to browse to the directory.
Apache2 Log Files (CentOS)
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
172.16.200.132 - - [10/May/2014:14:34:01 +0100] "GET /squid/ HTTP/1.1" 403 288 "-" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.131 Safari/537.36"
Does anyone have any suggestions, I have tried changing the user Apache runs under to admin which is a user that has full access to the /var/log/squid/ directory but doesn't have access to any system services /etc/init.d/ or the ability to run commands such as (halt, service).
Any suggestion please.
Error Log from Apache
[Mon May 12 17:53:11 2014] [error] [client 172.16.200.132] (13)Permission denied: Can't open directory for index: /var/log/squid/
From the log OP posted, the interesting part is )Permission denied: Can't open directory for index:.
To solve this, change line Options None to Options +Indexes
References: official documentation

Error 404 on uploading blob to production server on google app engine

I'm building a system where the users will upload articles to my app and I need to store them. I've read the tutorial about blobhandlers on Google's documentation and it worked, but only local.
When I test the app on development server, everything is fine, but on production server, I get Error 404 and the following logs:
2014-02-17 08:59:28.490 /http://ciro-app-id.appspot.com/_ah/upload/AMmfu6ah2vpKNsIDSzlpYPqAgnQ_zznnUwDweG571CgMMnGlluXc1GJS0i42UYYOKVZNQMBhzyY3grQFeCgD4hf4usx_YeMwy4n_93qM-QFegsMIFHDkNovRcJ9Rnl9li91bo4bdClfV/ALBNUaYAAAAAUwJCQ_kw2ANG1Tnvs9OIU6cAyOUDscqL/ 404 19ms 0kb Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36 module=default version=1
186.226.15.242 - - [17/Feb/2014:08:59:28 -0800] "POST /http://ciro-app-id.appspot.com/_ah/upload/AMmfu6ah2vpKNsIDSzlpYPqAgnQ_zznnUwDweG571CgMMnGlluXc1GJS0i42UYYOKVZNQMBhzyY3grQFeCgD4hf4usx_YeMwy4n_93qM-QFegsMIFHDkNovRcJ9Rnl9li91bo4bdClfV/ALBNUaYAAAAAUwJCQ_kw2ANG1Tnvs9OIU6cAyOUDscqL/ HTTP/1.1" 404 188 "http://ciro-app-id.appspot.com/enviar" "Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36" "ciro-app-id.appspot.com" ms=20 cpu_ms=0 cpm_usd=0.000021 app_engine_release=1.9.0 instance=00c61b117c6c9b0c25f5b86e2eadac83e2908691
Here is my code: https://drive.google.com/file/d/0B1-lpPH97tV2dzN6aURYVENCMzQ/edit?usp=sharing
Here is my app: ciro-app-id.appspot.com
Try it yourself
Login credentials:
Email: ciromoraismedeiros#gmail.com
Password: 123
Access ciro-app-id.appspot.com/enviar fill the form and submit it.
Obs.: I'm Brazillian, so everything is in portuguese language.
Notice the leading "/" in your request log? In /templates/enviar_artigo.html, change
<form action='/{{upload_url}}' ...>
to
<form action='{{upload_url}}' ...>

Resources