AWSへrailsで構築したアプリケーションを設定しています。
paperclipを利用して、S3へ画像をuploadしたのですが、画像のURLが
https://s3-ap-northeast-1.amazonaws.com/取得したドメイン/画像ファイル名となります。
と設定したいのですが、該当する内容を見つけることができるず、どなたか対応方法をご教授いただければと存じます。
リバースプロキシはnginxを利用していますので、できればnginx経由でアクセスをさせたいと考えています
nginxの設定
events { worker_connections 2048; } http { error_log /var/www/blog/log/nginx.error.log; #自分のアプリケーション名 access_log /var/www/blog/log/nginx.access.log; #自分のアプリケーション名 include /etc/nginx/mime.types; # max body size client_max_body_size 2G; upstream app_server { # for UNIX domain socket setups server unix:/var/www/blog/tmp/sockets/.unicorn.sock fail_timeout=0; #自分のアプリケーション名 } server { listen 80; server_name サイトIP; # nginx so increasing this is generally safe... keepalive_timeout 5; # path for static files root /var/www/blog/public; #自分のアプリケーション名 # page cache loading try_files $uri/index.html $uri.html $uri @app; location @app { # HTTP headers proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://app_server; } # Rails error pages error_page 500 502 503 504 /500.html; location = /500.html { root /var/www/blog/public; #自分のアプリケーション名 } } }
回答1件
あなたの回答
tips
プレビュー