在我的 /etc/nginx/nginx.conf 文件中我有配置。作为:-
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
include /etc/nginx/conf.d/*.conf;
}
Run Code Online (Sandbox Code Playgroud)
现在,我不喜欢污染上面的默认 nginx.conf 文件,所以我将 /etc/nginx/conf.d/default.conf 中的配置保留为:-
worker_processes 2;
events {
worker_connections 2048;
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,在上面的场景中,nginx 会从default.conf 文件或nginx.conf 文件中覆盖或选择worker_processes 和worker_connections 的配置吗?另外,我想知道nginx如何简单地处理配置文件?
内部控制器:
def update
@user.update({approved: true})
UserMailer.send_approved_mail(@user)
redirect_to(root_url)
end
Run Code Online (Sandbox Code Playgroud)
在user_mailer.rb中
class UserMailer < Devise::Mailer
def send_approved_mail(user)
@resource = user
email_body = render "user_activated_mail"
if @resource.valid?
client = Postmark::ApiClient.new(ENV["POSTMARK_API_KEY"])
client.deliver(from: ENV["POSTMARK_SIGNATURE"],
to: @resource.email, subject: "User Activation information.",
tag: 'account-activated', :content_type => "text/html",
html_body: email_body)
end
end
end
Run Code Online (Sandbox Code Playgroud)
在rails 4.1.0中,正在调用控制器中的方法并且正在发送电子邮件,但是在rails 4.2中,控制器中的邮件程序方法没有被调用,但是当从rails控制台调用时它可以工作.我为postmark api和配置文件做了所有必要的配置.唯一的事情是在rails 4.1.0中,控制器内部的邮件程序被调用,但在rails 4.2中,它从rails console调用时不起作用.究竟是什么原因无法弄明白.
dockerfile包括: -
FROM ruby:2.2.3-slim
MAINTAINER Milan Rawal <milan@gmail.com>
RUN apt-get update && apt-get install -qq -y build-essential nodejs libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core curl htop --fix-missing --no-install-recommends
ENV INSTALL_PATH /air_scout
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY Gemfile Gemfile
RUN bundle install
COPY . .
RUN bundle exec rake RAILS_ENV=production SECRET_TOKEN=f6801f0744ff2e86b0baa542fc55075b5b79c922c518e34484cfe6a6c2149510973fa6c90d36c05907f8bf9114b6b33594f3630810b332ef3717b8b8f4f04b1f assets:precompile
VOLUME ["$INSTALL_PATH/public"]
CMD bundle exec unicorn -c config/unicorn.rb
Run Code Online (Sandbox Code Playgroud)
docker-compose.yml文件包含: -
version: '2'
services:
mongodb:
image: mongo:latest
ports:
- '27017:27017'
volumes:
- air_scout-mongodb:/data/db
redis:
image: redis:3.0.5
ports:
- …Run Code Online (Sandbox Code Playgroud) link_to方法未被禁用: -
<%= link_to edit_cabinet_path(object), remote: true, disabled: true do %>
<span class="glyphicon glyphicon-pencil"></span>
<% end %>
Run Code Online (Sandbox Code Playgroud)
但如果我喜欢下面隐藏链接
<%= link_to edit_cabinet_path(object), remote: true, style: "display:none;" do %>
<span class="glyphicon glyphicon-pencil"></span>
<% end %>
Run Code Online (Sandbox Code Playgroud)
现在的问题是如何使用块禁用这种类型的链接,并解释第二个代码工作的原因,而不是第一个代码.
这段代码如下: -
int x = -24;
uint y = (uint) x;
Console.WriteLine("*****" + y + "********");
// o/p is *****4294967272********
Run Code Online (Sandbox Code Playgroud)
为什么在C#中这种行为,详细阐述会有所帮助.谢谢你们.