Created
March 11, 2015 20:36
-
-
Save mmmpa/36cd30aa1a3f24d319f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name outer.mmmpa.net; | |
autoindex on; | |
# ファイル表示するときの | |
location / { | |
# 最終的にファイルが保存されるパスとか | |
root /app/outer_uploader/uploaded; | |
index index.html; | |
} | |
# アップロードするときの | |
location ~ ^/upload$ { | |
# 実際はベーシック認証とかかけると思う | |
if ($request_method = POST) { | |
# @sinatra は下部で定義 | |
upload_pass @sinatra; | |
# @sinatra の実行者が手を出せる場所を設定する | |
upload_store /app/outer_uploader/temp; | |
upload_store_access user:rw group:rw all:rw; | |
upload_set_form_field "$upload_field_name[filename]" "$upload_file_name"; | |
upload_set_form_field "$upload_field_name[tempfile]" "$upload_tmp_path"; | |
upload_aggregate_form_field "$upload_field_name[size]" "$upload_file_size"; | |
upload_pass_form_field ".*"; | |
} | |
} | |
# アップロード後にパラメーターが渡されるアプリケーションへ proxy | |
location @sinatra { | |
proxy_redirect off; | |
proxy_pass http://localhost:1192; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment